Unix Timestamp Converter
Turn a Unix timestamp, counted in seconds or milliseconds since 1970-01-01 UTC, into a date and time, or turn a date and time back into a timestamp.
Whole numbers only, for example 1700000000 or -86400. A minus sign means a time before 1970.
Write it as 2024-02-29T12:00:00Z or 2024-02-29 12:00:00. Text with no zone is read as UTC.
How to use
- To read a timestamp, type or paste it into the Unix timestamp box. The UTC date, ISO 8601 form, your own time zone and both unit values fill in below.
- Leave Unit on Auto unless the guess is wrong. Pick Seconds or Milliseconds to force a reading.
- To go the other way, type a date and time into the Date and time (UTC) box, for example
2024-02-29T12:00:00Z. The seconds and milliseconds figures below show the timestamp. - Press Now to load the current time from this browser.
Worked example
Enter 1700000000. It has ten digits, so Auto reads it as seconds. The tool shows 2023-11-14 22:13:20 UTC, the ISO form 2023-11-14T22:13:20.000Z, and 1,700,000,000,000 milliseconds. Paste the thirteen-digit 1700000000000 instead and Auto reads milliseconds, giving the same moment.
Going back, 2024-02-29T12:00:00Z becomes 1709208000 seconds, or 1709208000000 milliseconds. Negative values work too: -86400 is exactly one day before the epoch, 1969-12-31 00:00:00 UTC, and 0 is 1970-01-01 00:00:00 UTC.
How it works
Unit rule. A timestamp with 11 digits or fewer is read as seconds, and one with 12 digits or more as milliseconds. Leading zeros are not counted. Choose Seconds or Milliseconds to override the rule. A minus sign counts back from 1970. Decimals are refused, because a timestamp is a whole number of seconds or milliseconds.
Range. A JavaScript date holds up to 8,640,000,000,000,000 milliseconds either side of 1970-01-01T00:00:00Z. Values outside that range are refused.
Date and time. Enter a date and time with a zone of Z, or with no zone. Both are read as UTC. Other zones are refused. Your own zone is shown separately, using the time zone settings of this browser.
Now fills the timestamp field with the current time, read from this browser, in the selected unit. With Auto, it uses seconds.
Unix time counts the seconds since the epoch, 00:00:00 UTC on 1 January 1970, and ignores leap seconds, so every day has exactly 86,400 of them. The definition is in the POSIX section on Seconds Since the Epoch. The ISO form follows RFC 3339, the internet profile of ISO 8601.
Nothing you type is sent anywhere. Every conversion is done by your browser, and no timestamp or date is stored.
Common mistakes
- Mixing seconds and milliseconds. JavaScript's
Date.now()returns milliseconds, while most Unix tools, databases and JWT claims use seconds. Read as seconds, a millisecond value lands tens of thousands of years in the future, and the reverse puts you in January 1970. - Assuming the string has a time zone. A timestamp is always UTC. The zone only appears when you format it for display, so two people in different countries can read the same number as different clock times.
- Forgetting leap years and the 2038 limit. Systems that store seconds in a signed 32-bit integer overflow after 2038-01-19 03:14:07 UTC, which is 2147483647 seconds. Try that value in the tool.
- Converting a local time without saying so. If you type a time with no zone here it is read as UTC, not as your clock. Convert first if you start from local time.
- Treating the number as a duration. A timestamp is a point in time. To measure how long something took, subtract two timestamps.
Frequently asked questions
What is the Unix epoch?
It is the starting point, 1 January 1970 at 00:00:00 UTC. Timestamp 0 is that instant.
How do I tell seconds from milliseconds by eye?
Count the digits. Current dates in seconds have ten digits, and in milliseconds thirteen. That is the rule the Auto setting follows.
Why does the local time differ from the UTC time?
The local line uses your browser's time zone, including any daylight saving offset in force on that date. UTC never changes with the seasons.
Can it handle dates before 1970?
Yes. Enter a negative number or a date such as 1969-12-31T00:00:00Z.
Are my timestamps sent anywhere?
No. The conversion runs in your browser, and nothing is stored.
Related tools
- JWT Decoder, where exp, nbf and iat claims are timestamps in seconds.
- Cron Builder and Explainer to plan when a job will run.
- Time Zone Converter and Date Calculator for working with local dates.