← Back to DevKit

Timestamp Converter

TIMESTAMP · DATA & PROCESS

Convert timestamps to dates and back; auto-detects 10-digit seconds and 13-digit milliseconds, with time zones and relative time.

Timestamp → date (multi-line batch)
Date → timestamp
—
Converted · original vs result
Notes
A Unix timestamp counts seconds/milliseconds since 1970-01-01 00:00 UTC; 10-digit is auto-read as seconds and 13-digit as milliseconds, plus negatives (pre-1970) and fractional seconds. Switching the time zone refreshes the whole table live; lines over 10,000 characters skip detection. Relative time is computed from your local clock.

>_ USAGE GUIDE

Paste multi-line text — a whole log file if you like — and every line is probed for a timestamp: matched lines convert to readable times, unmatched lines pass through unchanged, and the output is an aligned "original | result" table with a "copy result column" button that copies just the converted times for your ticket or report. Detection covers 10-digit seconds (fractional seconds included) and 13-digit milliseconds, supports negatives (pre-1970), and skips values wildly outside the realistic range rather than forcing a conversion.

  1. Paste your log: each line is scanned; seconds, milliseconds, fractional and negative values are all handled
  2. Pick the time zone: browser local, UTC, or a common city (Shanghai, Tokyo, Singapore, London, Paris, New York, Chicago, Los Angeles, Sydney) — switching refreshes the whole table live
  3. Pick the output format: ISO 8601 (default, with offset), a custom template (YYYY-MM-DD HH:mm:ss style), or RFC 2822 for mail headers
  4. Copy the result column: only the converted times are copied, ready to paste back

Reverse conversion works as before: pick a date and time to get the Unix timestamp. All conversion runs locally in your browser with no network requests.

>_ FAQ

Q1 · What is the difference between 10-digit and 13-digit timestamps?

10 digits count in seconds (like 1735689600), 13 digits in milliseconds (like 1735689600000) — a factor of 1000 apart, but the same instant. Conventions differ: Linux shells and databases favor seconds, while Java's System.currentTimeMillis() and JavaScript's Date.now() return milliseconds. This tool auto-detects the width on every line, so there is nothing to switch manually.

Q2 · How do I batch-convert timestamps inside a log?

Paste the whole log into the input area — the tool scans line by line, converts timestamp lines to readable times, and keeps non-timestamp lines as-is in the aligned two-column view. Logs mixing 10-digit seconds, 13-digit milliseconds, fractional seconds and even negatives all work; "copy result column" copies just the converted times. Lines longer than 10,000 characters skip detection to keep the response snappy.

Q3 · Can I display the times in a specific time zone?

Yes. The time-zone dropdown offers browser local, UTC, and common cities (Shanghai, Tokyo, London, New York, Los Angeles, and more); switching refreshes all results live. When debugging cross-time-zone systems, flip between the remote zone and your local one — an 8-hour offset becomes obvious immediately.

Q4 · The converted time is 8 hours off from my log — what is wrong?

Time zones. A Unix timestamp carries no zone — it is an absolute instant; the difference comes from whichever zone the reader applies. Beijing is UTC+8, so a log written in UTC but read in UTC+8 shows an 8-hour shift. Compare the tool's UTC option against your local zone to confirm this kind of drift.

Q5 · Why do some APIs require a timestamp instead of a date string?

A timestamp is an absolute instant with no zone ambiguity, immune to server/client time-zone differences, and directly comparable (for example, checking token expiry). Passing date strings between systems in different zones invites format- and interpretation-related bugs; a timestamp has exactly one meaning.

Embed code

Paste the code below into your page to embed this tool as an iframe (nav and footer auto-hidden).

Heightpx
This tool runs entirely in your browser — input never leaves your device. Press Ctrl K to switch tools anytime.