Skip to content
← Back

Timestamp Converter - Unix Timestamp Online Converter

Media
Runs locally · Not uploaded

Online Unix timestamp converter: auto-detects seconds, milliseconds, microseconds. Supports Local, UTC, ISO 8601, and relative time. Essential for developers debugging timestamps.

Was this result helpful?

For local tools, open DevTools → Network and search your input — it should not appear in requests.

Next steps

Usage Guide

A Unix timestamp is the seconds/milliseconds/microseconds/nanoseconds elapsed since 1970-01-01 00:00:00 UTC — everywhere in databases, logs, APIs, and high-resolution clocks in Go/Java. This tool converts both ways, auto-detects units, supports batch line conversion and zone comparison, steering you around the classic "off by 8 hours" and "off by 1000×" traps.

1. Two-way conversion and unit auto-detect

The key concept: **a timestamp has no time zone** — it is an absolute moment. "Eight hours off" lives in the formatting layer; "1000× off" lives in the unit layer (ms read as seconds or the reverse). When values disagree, unify units first, then UTC vs local display.

  1. Timestamp → date: paste a numeric stamp; auto mode classifies s / ms / µs / ns by magnitude and shows local, UTC, ISO, and relative time.
  2. Date → timestamp: pick a datetime to get common-precision stamps.
  3. Batch: one stamp per line; bad lines error individually while others still convert — handy for a column scraped from logs.

2. Rules every developer should know

  • Store UTC timestamps always; convert to local only at the display layer — storing local time in a database is the mother of all bugs.
  • Rough digit counts: ~10 s, ~13 ms, ~16 µs, ~19 ns; for boundary values trust auto instead of mental arithmetic alone.
  • Mind the 2038 problem: 32-bit second stamps overflow — use 64-bit in new systems.
  • Log comparison: servers on UTC, containers possibly without TZ set, your laptop at UTC+8 — unify the base first.

3. Three hidden traps in JavaScript date handling

First, Date.getMonth() returns 0-11 — January is 0, and that off-by-one has caused countless incidents. Second, new Date('2026-01-01') and new Date('2026/01/01') parse differently (ISO date strings anchor to UTC midnight, slash format to local time), so identical code drifts across browsers and locales. Third, Date.parse tolerance for non-standard formats varies by engine — Safari historically returns NaN for '2026-01-01 00:00:00' (space-separated). Engineering conclusion: parse inputs exclusively via ISO 8601 or explicit year/month/day components, and delegate formatting to Intl.DateTimeFormat rather than hand-built strings.

4. Timestamp practices inside databases

  • MySQL TIMESTAMP columns convert through the session time zone (readings shift when it changes), while DATETIME stores a literal — teams must agree on which zone the literal means.
  • PostgreSQL timestamptz stores an absolute UTC instant and renders per session zone — closest to the timestamp's true semantics; prefer it for new projects.
  • Encode the unit in the column name or docs (created_at_ms); a bare created_at is a ticking bomb during debugging.

5. Mental math: mapping timestamps to decades

A few anchors worth memorizing: 10-digit 1600000000 = Sep 2020, 1700000000 = Nov 2023, 1800000000 = Jan 2027. On seeing an unfamiliar stamp, check length and leading digits first: 13 digits starting 17-18 means 2020s milliseconds; 10 digits starting 1.7-1.8 means 2020s seconds. Coarse anchoring saves repeated round-trips to a converter during log triage.

6. Where µs / ns come from: Go, Java, and digit explosion

Beyond familiar seconds and milliseconds, modern runtimes often emit microseconds or nanoseconds: Go’s time.Now().UnixNano(), some Java Instant serializations, high-resolution trace spans. Rough bands: seconds < 1e10, milliseconds < 1e13, microseconds < 1e16, then nanoseconds — this tool’s auto mode follows that split (a past bug treated 19-digit values as seconds; it now classifies them as ns). If you already know the unit, lock it in the UI so extreme boundary values are not classified into the neighboring bucket.

FAQ

Auto mode classifies by magnitude: roughly 10 digits for seconds, 13 for milliseconds, 16 for microseconds, and 19 for nanoseconds (Go's time.Now().UnixNano() commonly shows 19). Boundary values can land in the adjacent bucket, so lock the unit manually when you know it.

A timestamp has no timezone; it is an absolute instant. The 8-hour gap comes from the formatting layer (inconsistent UTC vs local display), and the 1000× gap from the unit layer (seconds mistaken for milliseconds). Fix the unit first, then make the timezone display consistent.

Yes. Batch input takes one timestamp per line: valid lines return local/UTC/ISO results, while invalid lines error individually without blocking the rest — ideal for copying a column out of logs to align a timeline.

Three big ones: getMonth() returns 0–11, so January is 0; new Date('2026-01-01') parses at UTC midnight while new Date('2026/01/01') uses the local timezone; and Safari has historically returned NaN for the space-separated '2026-01-01 00:00:00'. The practical rule: accept only ISO 8601 input and delegate formatting to Intl.DateTimeFormat.

Always store UTC. MySQL's TIMESTAMP converts with the connection timezone (readings change when it does) while DATETIME stores a literal, so teams need an explicit convention; PostgreSQL's timestamptz stores the UTC instant and renders per session timezone, making it the preferred choice for new projects. Also encode the unit in the column name (created_at_ms) — a bare created_at is a time bomb when debugging.

None. Line-by-line parsing and conversion happen in your browser; the pasted log content never leaves your machine.

Related Tools

Related Articles