Skip to main content

Unix Timestamp & Timezone Converter

Convert 10-digit seconds, 13-digit milliseconds, negative epochs, and strict ISO-8601 dates across UTC and IANA time zones with a time difference calculator.

By Lasita Engineering TeamLast reviewed: Examples verified by hand & automated test suite

How to Avoid Seconds vs. Milliseconds Bugs

Mixing 10-digit Unix seconds (common in Python, Go, PostgreSQL, and JWT exp/iat claims) with 13-digit JavaScript or Java milliseconds is one of the most frequent incident-debugging traps:

  • 10-digit seconds: 1795370400 → 2026-11-22T18:00:00Z (passing this directly to new Date(1795370400) in JS mistakenly produces January 1970).
  • 13-digit milliseconds: 1795370400000 → 2026-11-22T18:00:00Z (passing this to a seconds-expecting API jumps into the year 58,000+).
  • Verified check: 1795368000 is 2026-11-22T17:20:00Z, exactly 40 minutes before 1795370400.
  • Negative & fractional epochs: -86400 resolves to 1969-12-31T00:00:00Z, and negative decimals like -1.5 floor to -2 seconds.

Storage & Logging Best Practices

  1. Store timestamps as UTC Unix integers or ISO-8601 strings with explicit Z or numeric offsets (2026-11-22T18:00:00Z).
  2. Convert to canonical IANA zones (such as Asia/Kolkata or America/New_York) only at display time so daylight saving transitions remain accurate.
  3. Use the Unit selector whenever inspecting intentionally early 1970s millisecond timestamps.

Limits

JavaScript Date values cover roughly ±8.64 × 1015 milliseconds around 1970. ISO date inputs without a timezone offset are explicitly interpreted as UTC and labeled on screen.

Frequently Asked Questions

How does the converter tell 10-digit seconds from 13-digit milliseconds?

In Auto-detect mode, absolute values below 100,000,000,000 (1e11) are treated as Unix seconds — covering negative pre-1970 dates, 9-digit timestamps from the 1990s/2000s, and 10-digit timestamps through year 5138. Values between 1e11 and 1e14 are treated as milliseconds. You can always override the unit manually.

Why does the date input reject 2026-02-30 or free-form text like "foo 12"?

JavaScript Date.parse() behaves inconsistently across Chrome, Firefox, and Safari and silently rolls impossible dates like February 30 into March 2. Lasita uses a strict cross-browser ISO-8601 parser that rejects impossible dates and shows exactly how every valid date was interpreted.

Why does 1795368000 convert to 17:20:00Z instead of 18:00:00Z?

Because 1795368000 seconds after 1970-01-01T00:00:00Z is exactly 2026-11-22T17:20:00Z. Exact 18:00:00Z on November 22, 2026 is 1795370400 (2,400 seconds / 40 minutes later). Both 1795370400 and 1795370400000 resolve to 2026-11-22T18:00:00Z.

Read the full engineering reference: Practical Reference for Everyday Developer Data: JSON, Regex, Unix Timestamps, Base64 & WCAG Contrast →