Unix Timestamp Converter
Paste an epoch in seconds, milliseconds, microseconds or nanoseconds to see the date, or pick a date and time zone to get its epoch.
Timestamp to date
Date to timestamp
How to use it
- The current Unix time runs at the top. Press Copy to copy the seconds or milliseconds value.
- Paste a timestamp into Unix timestamp. The unit is guessed from the length of the number; pick the unit yourself if the guess is wrong.
- Read the result as local time, UTC, ISO 8601, RFC 2822 and relative time, and copy the line you need.
- For the other direction, enter a date and time, choose the time zone, then copy the epoch in seconds or milliseconds.
What a Unix timestamp is
A Unix timestamp, often just called epoch time, is the number of seconds since 1 January 1970 at 00:00:00 UTC. The value 1700000000 is 14 November 2023 at 22:13:20 UTC, which was 5:13:20 PM the same day in New York. Because it counts from UTC, the same number means the same moment everywhere; only the way it is displayed changes. Leap seconds are not counted, so every day in Unix time is exactly 86,400 seconds long. Moments before 1970 are negative: -86400 is 31 December 1969 at 00:00 UTC.
How the unit is detected
Many systems store epochs in milliseconds or finer units. This tool guesses from the size of the number: below 1011 it reads seconds, below 1014 milliseconds, below 1017 microseconds, and anything larger nanoseconds. So a 10-digit number is read as seconds and a 13-digit one as milliseconds. With these limits, every unit other than seconds is read as a date between 3 March 1973 and 16 November 5138. For milliseconds before March 1973, pick the unit yourself. A 19-digit nanosecond value is more precise than an ordinary JavaScript number can hold, so the math uses BigInt and no digit is rounded away.
The year 2038 problem
Many older systems store the epoch as a signed 32-bit integer, whose largest value is 2,147,483,647. That falls on 19 January 2038 at 03:14:07 UTC. One second later the counter overflows to -2,147,483,648, which reads as 13 December 1901 at 20:45:52 UTC. 64-bit systems are not affected, but the old limit survives in many places: MySQL's TIMESTAMP column type, for example, only goes up to 2038-01-19 03:14:07 UTC. Type 2147483647 and then 2147483648 above to see the last second and the one after it.
Seconds or milliseconds in common languages
The most common bug is mixing the two. Sending Date.now() to an API that expects seconds produces a date around the year 58,000, while seconds read as milliseconds land in January 1970.
Questions
How do I convert a timestamp to a date in Excel or Google Sheets?
=A1/86400+DATE(1970,1,1) and format the cell as date and time. The result is in UTC; add or subtract your offset as a fraction of a day, for example -5/24 for US Eastern standard time. For milliseconds, divide by 86400000 instead.