A Unix timestamp (or epoch time) counts seconds since January 1, 1970, 00:00:00 UTC. It provides a universal, timezone-independent way to represent time in software.
Examples
- 0 = Jan 1, 1970 00:00:00 UTC
- 1000000000 = Sep 9, 2001
- 1700000000 = Nov 14, 2023
Why It Matters
Databases, APIs, and programming languages use Unix timestamps for reliable date/time storage and comparison. It avoids timezone confusion and daylight saving issues.
Year 2038 Problem
32-bit systems store timestamps as signed integers, maxing out at 2,147,483,647 (Jan 19, 2038). Most modern systems use 64-bit timestamps to avoid this.
Unix Timestamps and Time Zones
A Unix timestamp itself has no time zone β it's always UTC seconds since the epoch. The confusion people run into is entirely in the display layer: converting the same timestamp to "local time" produces a different-looking date/time depending on the viewer's time zone, even though the underlying number never changes. This is exactly why storing timestamps as Unix time (rather than pre-formatted local strings) avoids a huge class of software bugs.
Milliseconds vs. Seconds
Unix time is defined in seconds, but many programming languages and JavaScript's Date object use milliseconds instead β multiplying or dividing by 1,000 incorrectly is one of the most common timestamp bugs in web development, often showing dates from the year 1970 or the year 50,000+ when the units are mismatched.