Unix Timestamp Converter
Convert between Unix timestamps, ISO 8601 dates, and human-readable times across any timezone — instantly. Paste a Unix timestamp (seconds or milliseconds — auto-detected) and get the ISO 8601 representation, the RFC 3339 offset notation, the date-time in any IANA-named timezone, and the relative offset from now. Or enter a date-time and get the Unix epoch seconds. The Unix epoch is 1970-01-01T00:00:00Z per POSIX.1-2017 §4.16 ('Seconds Since the Epoch'). Millisecond timestamps = Unix seconds × 1000. Auto-detection rule: values greater than 10¹² are milliseconds (since January 9, 2001 at 01:46:40 UTC, all second-based timestamps have been 10 digits; millisecond timestamps are 13 digits). Primary sources: RFC 3339 (date-time internet standard), ISO 8601:2004, POSIX.1-2017 §4.16, IANA Time Zone Database (iana.org/time-zones), ECMAScript 2024 Date specification.
The same instant in ISO 8601 / RFC 3339 internet format is 2023-11-14T22:13:20.000Z. Convert this UTC instant to any local timezone with the IANA database (Intl.DateTimeFormat).
View the TypeScript implementation on GitHub: packages/calc/src/unix-timestamp.ts · view tests
What this means
A Unix timestamp is just a count: the number of seconds elapsed since 1970-01-01T00:00:00Z, excluding leap seconds, as defined by POSIX.1-2017 §4.16. Because it’s a single integer with no timezone attached, it’s the most unambiguous way to represent a moment in time — two systems anywhere on Earth agree on what 1700000000 means, with no room for the timezone confusion that plagues human-readable date strings. ISO 8601 / RFC 3339 is the human- and machine-readable counterpart: the same instant written as 2023-11-14T22:13:20Z, self-documenting and lexicographically sortable.
In my experience, the single most expensive timestamp bug is the seconds-versus-milliseconds mix-up. I’ve seen a backend hand a frontend a value in seconds, the frontend pass it straight to new Date()(which expects milliseconds), and every record silently render as January 1970 — off by a factor of exactly 1000. I’ve found the fastest way to catch it is the digit-count smell test: a present-day timestamp in seconds is 10 digits, and in milliseconds it’s 13. That’s why this converter makes the unit an explicit toggle rather than guessing — a wrong guess is a silent 1000x error, and silent is the worst kind.
The second gotcha is timezone leakage. The rule that has never failed me: store and compute in UTC, and convert to a local timezone only at the moment you render to a human. Unix timestamps and ISO 8601 with a Z suffix are both unambiguous; a bare YYYY-MM-DD or a timezone abbreviationlike “EST” is not. For anything timezone-aware, use IANA names (America/Chicago) with Intl.DateTimeFormat, which applies the correct DST rules from the IANA database automatically.
Worked example
Take the epoch value 1700000000 in seconds. First normalize to milliseconds: 1,700,000,000 × 1000 = 1,700,000,000,000 ms. Feeding that to new Date(1700000000000).toISOString() yields 2023-11-14T22:13:20.000Z— the canonical ISO 8601 / RFC 3339 form.
To find the day of week, divide by the seconds in a day: 1,700,000,000 ÷ 86,400 = 19,675.9… whole days after the epoch. The epoch (1970-01-01) was a Thursday(weekday index 4). 19,675 mod 7 = 4, so we advance four weekdays from Thursday → Friday, Saturday, Sunday, Monday… which wraps to Tuesday. The converter agrees: 2023-11-14 was a Tuesday.
The reverse direction round-trips exactly. Paste 2023-11-14T22:13:20Z into the date field and Date.parse() returns 1,700,000,000,000 ms, which divided by 1000 is 1,700,000,000epoch seconds — the value we started with. And an RFC 3339 offset form of the same instant, 2023-11-14T17:13:20-05:00, parses to the identical epoch, because the offset is folded into the absolute instant.
Frequently asked questions
The information and tools on this website are for general educational purposes only and do not constitute financial, investment, legal, or tax advice. Consult a licensed professional for decisions specific to your situation.