What is a Unix Timestamp?

How computers count time and why it matters for developers

Time as a Single Number

A Unix timestamp is the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC. This moment is called the Unix epoch. A timestamp like 1724457600 means 1,724,457,600 seconds have passed since that origin point.

Why 1970? Unix operating systems were being developed then, and the designers needed a fixed starting point. The choice was arbitrary — what matters is that it's a universal agreement.

Why Developers Use Timestamps

Representing time as a single integer has major practical advantages:

  • No timezone ambiguity: A timestamp is always UTC. There's no confusion about whether "3pm" means London, Tokyo, or New York.
  • Easy arithmetic: Subtracting two timestamps gives you the duration in seconds. Adding 86400 (seconds in a day) advances the time by one day.
  • Universal sorting: Timestamps sort correctly when sorted numerically or as strings, unlike locale-specific date formats.
  • Compact storage: A 32-bit integer fits a timestamp. Storing "2024-08-24T00:00:00Z" as text takes far more space.

Seconds vs Milliseconds

Classic Unix timestamps count in seconds. JavaScript's Date.now() and many web APIs return milliseconds — timestamps 1,000 times larger.

Seconds:      1724457600   (10 digits)
Milliseconds: 1724457600000 (13 digits)

A quick way to tell: if the number has 10 digits, it's seconds. If it has 13 digits, it's milliseconds. The Votilo Tools converter detects this automatically.

The Year 2038 Problem

A signed 32-bit integer can hold values up to 2,147,483,647 — which corresponds to January 19, 2038. Systems that store timestamps as 32-bit integers will overflow on that date, similar to the Y2K issue. Modern systems use 64-bit integers, which won't overflow for another 292 billion years.