A developer's guide to Unix time and epochs. Learn how computers track time, convert seconds and milliseconds to ISO dates, and solve the Year 2038 problem.
Calculate your numbers instantly in your browser. Fast, free, no signup.
Human timekeeping is filled with messy irregularities: leap years, leap seconds, daylight saving transitions, and 24 time zones. If computer databases and operating systems attempted to store dates using strings like "Tuesday, March 14, 2026 at 3:30 PM CST", sorting, comparing, and syncing data across global servers would be computationally chaotic.
To solve this, computer scientists established a universal, monotonic, time-zone-independent counter known as Unix Time (or POSIX time).
The Unix Epoch is the arbitrary reference point chosen as time zero:
00:00:00 UTC on Thursday, January 1, 1970
A Unix timestamp is simply the total number of elapsed seconds (or milliseconds) since this exact moment, ignoring leap seconds.
0, the time is exactly 1970-01-01T00:00:00Z.1726982400), the event occurred after 1970.-315619200), the event occurred before 1970 (such as 1960-01-01).A frequent point of confusion among web developers is whether a timestamp is formatted in seconds or milliseconds:
time.time()), PHP, and Unix shell utilities.
1726982400 (September 22, 2024)Date.now(), new Date().getTime()) and Java (System.currentTimeMillis()).
1726982400000If your timestamp has 10 digits, it is in seconds. Multiply by 1,000 before passing it to JavaScript's new Date(). If it has 13 digits, it is already in milliseconds.
Early Unix operating systems stored timestamps as 32-bit signed integers (int32_t).
The maximum positive value a 32-bit signed integer can store is $2^ - 1 = 2,147,483,647$.
At 03:14:07 UTC on Tuesday, January 19, 2038
At the very next second, the integer overflows and flips to negative -2,147,483,648, causing systems to suddenly jump back in time to December 13, 1901.
Modern 64-bit operating systems (int64_t) have solved this crisis. A 64-bit timestamp will not overflow for roughly 292 billion years — far longer than the projected lifespan of our universe!
Need to convert an obscure 10-digit or 13-digit Unix timestamp into a readable ISO 8601 string, UTC timestamp, or local calendar date? Use our free Timestamp Converter with live ticking epoch clock and bidirectional conversion.