What is the Unix epoch? Why computers count seconds from January 1, 1970

By TechCompare · Updated · How we check

Store wall-clock points in time as Unix timestamps and convert them to the user's local timezone for display. They're timezone-agnostic and supported by nearly every programming language and database, but wall clocks can jump forward or backward when they are synchronized, so use a monotonic clock for elapsed-time measurements.

Timestamp 0 in Unix time is 00:00:00 UTC on January 1, 1970, the Unix epoch. Every Unix timestamp is the number of seconds that have elapsed since that moment, not counting leap seconds. It's a simple system: one integer represents any point in time, independent of timezone and easy to sort and compare.

Unix timestamp
0
Seconds since epoch
ISO 8601
1970-01-01T00:00:00.000Z
Thu, 01 Jan 1970 00:00:00 GMT
Category
Fundamentals
Timestamp knowledge base

How this is calculated

Unix time counts seconds from the epoch. The published definition sets that epoch but doesn't establish that it was chosen to fit a 32-bit signed integer. The 2038 limit is a later consequence of storing Unix seconds in a signed 32-bit value, which overflows at 2,147,483,647 seconds after the epoch. Modern systems use wider timestamps to avoid that limit.

Verdict

Store an unambiguous timestamp and convert it for display in the user's timezone. Unix time counts seconds from January 1, 1970, and POSIX defines days as exactly 86,400 seconds while ignoring leap seconds. The documented definition doesn't establish that the epoch was selected to fit 32-bit timestamps. A signed 32-bit count reaches its limit on January 19, 2038, which is a consequence of that storage width, not a documented reason for choosing the epoch. Wider timestamp types avoid the limit.

More Timestamp scenarios

Frequently asked questions

Why is the Unix epoch January 1, 1970?
Unix time is defined to start at 00:00:00 UTC on January 1, 1970. The published definition doesn't establish why that date was selected or say it was chosen to fit a 32-bit integer. January 1, 1970, was a Thursday.
Does Unix time count leap seconds?
No, by convention Unix time ignores leap seconds. When a leap second is added to UTC, Unix timestamps continue counting as if the leap second didn't exist. POSIX defines the day as exactly 86,400 seconds regardless of actual UTC time. This keeps math simple at the cost of small drift over decades.
How do I convert a Unix timestamp to a human-readable date?
Use a built-in function in your language. JavaScript: new Date(timestamp * 1000).toISOString(). Python: datetime.fromtimestamp(timestamp, tz=timezone.utc).isoformat(). Go: time.Unix(timestamp, 0).UTC().Format(time.RFC3339). Most languages also have a timezone-aware variant. Always store UTC in your database and convert to local time only at the presentation layer.