How to Convert a Unix Timestamp to a Date
Learn what a Unix timestamp is, how the epoch works, how to convert seconds or milliseconds to a date, and how to turn a date back into a timestamp.
Quick Answer
A Unix timestamp is a count of seconds since a fixed starting point, and this Unix timestamp converter reads it both ways. Leave the direction on timestamp to date to turn a number like 1700000000 into a readable date, or switch it to the date to unix timestamp direction. Either way you get the UTC time, the ISO 8601 string, and your local time. It handles seconds or milliseconds, so the same page works as an epoch converter, an epoch time converter, a unix time converter, and a posix timestamp reader for logs, databases, and APIs.
Try The Unix Timestamp Converter →How Unix Time Works
The Unix epoch is midnight UTC on 1 January 1970. A timestamp is the number of seconds that have passed since that instant, so 0 is the epoch itself and negative values are earlier dates. To do unix time to date, the tool adds those seconds to the epoch and reads the result as a calendar date. Because the count always starts from UTC, a Unix timestamp is the same in every timezone: it names a single moment, not a local clock reading. That is why the same number means one exact instant whether you are in London, Mumbai, or Tokyo.
Examples
Timestamp to date. For example, 1700000000 seconds converts to 22:13:20 UTC on Tuesday 14 November 2023.
Date to timestamp. For example, entering 14 November 2023 at 22:13:20 (read as UTC) gives the Unix timestamp 1700000000, or 1700000000000 in milliseconds.
Spotting the wrong unit. For example, 1700000000000 read as seconds lands in the year 55901, a clear sign the value is milliseconds and the unit should be switched.
Seconds vs Milliseconds
The milliseconds vs seconds choice trips people up more than anything else. Classic Unix time counts seconds, so a present-day value has ten digits. JavaScript and many web APIs count milliseconds, which are 1000 times larger and have thirteen digits. A timestamp that looks wrong is often milliseconds read as seconds: if a date comes out thousands of years in the future, that is the cause. Going the other way, milliseconds to date just means dividing by 1000 first. This is also the Unix time versus a local calendar date distinction: the timestamp is a raw count from UTC, while the calendar date is how a person reads that moment in their own zone. Pick the matching unit before you convert and the date lands where you expect.