Unix Timestamp Converter
Convert Unix timestamps to dates and dates to timestamps — with timezone support
How to Use the Unix Timestamp Converter
- Enter a Unix timestamp (seconds or milliseconds) and convert to a readable date.
- Or pick a date/time and convert to a Unix timestamp.
Auto-detects seconds vs milliseconds. Shows UTC, ISO 8601, and local time.
What is a Unix Timestamp?
A Unix timestamp (also called POSIX time or Epoch time) is the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC (the Unix Epoch). It is the standard way to represent points in time in programming because it is timezone-independent, a single integer, and trivially comparable and sortable.
Common Uses
- Converting API response timestamps to readable dates for debugging
- Calculating time differences between two events
- Setting token expiry times (JWT exp claim is a Unix timestamp)
- Working with database timestamp columns in different timezones
Frequently Asked Questions
What is the difference between Unix timestamp in seconds vs milliseconds?
Unix timestamps are traditionally in seconds. JavaScript's Date.now() returns milliseconds. A 10-digit number is seconds, a 13-digit number is milliseconds. Divide by 1000 to convert milliseconds to seconds.
What happens in 2038?
The "Year 2038 problem" affects 32-bit systems where Unix timestamps are stored as signed 32-bit integers. On January 19, 2038, the value overflows. Modern 64-bit systems are not affected.
What timezone does a Unix timestamp use?
Unix timestamps are always in UTC. They represent an absolute moment in time regardless of timezone. When displaying a timestamp to a user, convert it to their local timezone.
Notes from this implementation
Seconds, milliseconds, and the year 2038
Unix time is seconds since 1970-01-01T00:00:00Z, not local time. A 10-digit number is seconds. A 13-digit number is milliseconds. This page has to branch on that, because multiplying a millisecond value by 1000 lands you in the year 50000 and looks like a bug. JavaScript’s Date uses milliseconds internally. The number you copy into a database column should match what the column stores.
The epoch converter is the same idea aimed at the epoch word people search for. The two pages share the concept and not the script, so the notes are written against each file. If you only need one, use this page for second and millisecond conversions and for reading an exp claim out of a JWT.
Local versus UTC
A timestamp does not have a time zone. The wall clock you see is the zone of the machine doing the display. Two colleagues in different zones should compare the number, not the hour.