Unix timestamps explained: epoch time made simple
Sooner or later you hit a number like 1756400000 where a date should be. That's a Unix timestamp, and once you get the idea it's beautifully simple.
One number, counting seconds
A Unix timestamp is just the number of seconds that have passed since midnight UTC on 1 January 1970 — a moment programmers call "the epoch." So 0 is that exact instant, 60 is one minute later, and today's timestamps are around 1.7 billion.
Why programmers love it
- No timezone confusion. It's a single universal instant. Formatting into a local time zone happens only when you display it.
- Easy math. "One hour later" is just
+3600. Comparing which event came first is comparing two numbers. - Compact and unambiguous. No "is that MM/DD or DD/MM?" — it's one integer.
Seconds vs milliseconds — the common gotcha
Unix timestamps are traditionally in seconds (10 digits today). But JavaScript and many APIs use milliseconds (13 digits). If a date comes out wrong by a factor of 1000 — landing in 1970 or far in the future — you've almost certainly mixed up seconds and milliseconds. Multiply or divide by 1000 to fix it.
Reading one quickly
You rarely convert these by hand — you paste the number into a converter and get a human date back (and vice versa). It's the fastest way to sanity-check a log entry, an API response, or a database field.
A note on 2038
Older systems stored timestamps in a 32-bit integer, which runs out in January 2038 (the "Year 2038 problem"). Modern systems use 64-bit values, good for billions of years — so it's a legacy concern, not something to lose sleep over.