All articles

Unix time: why computers count time from 1970

Unix time (Unix timestamp) is the number of seconds that have passed since January 1, 1970, 00:00:00 UTC. That date is called the "Unix epoch," and it's the reference point nearly every modern operating system, database, and programming language uses to count time.

Why 1970 specifically

The date wasn't chosen for any special event — it's purely practical: Unix developers at Bell Labs in the early 1970s simply picked the then-current year as a convenient round starting point. There's no deeper meaning behind the date.

Why this convention dominates API design

Most REST APIs — from payment processors to social platforms — return timestamps as a single Unix integer rather than a formatted string, precisely because it's unambiguous and timezone-agnostic on the wire. Client code converts it to a local date only at render time, avoiding the classic bug where a formatted date string gets parsed with the wrong assumed timezone.

The 2038 problem is still a live concern

Many older systems store Unix time as a signed 32-bit integer, which can only represent values up to January 19, 2038. Beyond that date, the number overflows — and this isn't purely historical: 32-bit embedded controllers, older industrial equipment, and legacy financial systems that are expensive or impractical to replace are still running in production today, and some of them will hit this wall before their hardware is due for retirement.

Why you'd need this

  • Converting a timestamp from logs or API responses into a readable date and time.
  • Computing the difference between two moments in time without manually working out the calendar.
  • Diagnosing time-zone-related issues when working with timestamps.

Unix Time and Leap Seconds

Unix time treats every day as exactly 86400 seconds, ignoring leap seconds that are occasionally added to UTC to compensate for the slowing rotation of the Earth. This means Unix time is technically not an exact reflection of UTC at the moments a leap second is inserted — most systems simply "smear" or repeat a second to avoid a jump in the counter.

Try the tool