How to convert a timestamp
A Unix timestamp counts the time since 1 January 1970 00:00:00 UTC, the epoch. It is how databases, logs, APIs and tokens usually record moments, because a single number is unambiguous and easy to compare. People, however, need dates.
Paste a timestamp in the first section. The unit is detected from its size: a 10-digit number is seconds, 13 digits is milliseconds, 16 microseconds and 19 nanoseconds. You can also force a unit. The result shows ISO 8601, a UTC string, the time in a time zone of your choice and a relative description such as 3 days ago. The live clock at the top shows the current Unix time, with a button to load it.
In the second section, type a date such as 2025-06-01 14:30:00 or a full ISO string with an offset, 2025-06-01T14:30:00+02:00, to get seconds and milliseconds. Dates without a zone are treated as UTC unless you untick the option, in which case your device's time zone is used.
Worked example
The timestamp 1700000000 has 10 digits, so it is read as seconds:
ISO 8601 2023-11-14T22:13:20.000Z
UTC Tue, 14 Nov 2023 22:13:20 GMT
Asia/Tokyo 15 Nov 2023 07:13:20
The same moment in milliseconds is 1700000000000. Converting the date back gives exactly the same two numbers, so the conversion round-trips.
Pitfalls
- Seconds versus milliseconds: JavaScript's
Date.now()returns milliseconds, while most other languages and JWT claims use seconds. A date in 1970 usually means a seconds value was read as milliseconds. - Time zones: a timestamp has none; only its display does. Always store UTC and convert at the edge.
- The year 2038: signed 32-bit seconds overflow on 19 January 2038. Use 64-bit values.
- Leap seconds are not counted in Unix time.
Token expiries are explained in the JWT decoder, and time-ordered IDs in the UUID generator.
Frequently asked questions
How does the tool know whether a number is seconds or milliseconds?
By magnitude. Values below about 100 billion are treated as seconds, up to 100 trillion as milliseconds, and larger ones as microseconds or nanoseconds. You can override the guess with the unit menu.
What time zone is used for the date to timestamp conversion?
By default dates without an offset are read as UTC. Untick the option to use your device's local time zone. A date with an explicit offset or Z is always exact.
Why does my timestamp show a date in 1970?
It is probably a value in seconds that was divided or interpreted as milliseconds. Pick the correct unit and the date will move to the expected year.
Does it handle negative timestamps?
Yes. Negative values are moments before 1970, down to the earliest date JavaScript can represent, in the year 271821 BC.