← All posts

Unix timestamps explained (and the 2038 problem)

Unix timestamps explained (and the 2038 problem)

A Unix timestamp is one of the most common ways to represent a moment in time, and also one of the most quietly confusing. It's just a number — something like 1735689600 — and that number hides a couple of traps worth knowing about.

What the number means

A Unix timestamp is the count of seconds since midnight UTC on 1 January 1970, a moment known as "the epoch." So 1735689600 is 1,735,689,600 seconds after that point, which works out to 1 January 2025, 00:00:00 UTC. Because it's anchored to UTC, the same timestamp refers to the same instant everywhere on Earth — your screen might show it in local time, but the number itself carries no timezone. That's exactly why systems love it: it's unambiguous and trivial to compare or sort.

Seconds or milliseconds?

Here's the first trap. Unix time is traditionally in seconds, but JavaScript's Date.now() and many APIs report milliseconds — the same instant times a thousand. Mix them up and you'll be off by a factor of 1000, which usually surfaces as a date in 1970 (you treated milliseconds as seconds) or tens of thousands of years out (the reverse). The quick check: a seconds timestamp for "now" is 10 digits; a milliseconds one is 13.

The 2038 problem

The second trap is a slow-motion one. A lot of older software stores Unix time in a 32-bit signed integer, and that counter runs out at 03:14:07 UTC on 19 January 2038. One second later it overflows and wraps around to a negative number — landing back in December 1901. It's the same shape of bug as Y2K, and it's why modern systems have moved to 64-bit time, which won't overflow for a comfortably absurd number of years. If you maintain anything long-lived that packs time into 32 bits, 2038 is a real date to plan around.

Converting without the headache

Most of the time you just want to turn a number into a readable date, or the reverse. Our Unix timestamp converter shows the current epoch live and converts both directions, handling seconds and milliseconds. If you only need one direction, epoch to date is the focused version, and the rest live under date & time tools.