Unix timestamps represent time as a single number — the number of seconds (or milliseconds) that have elapsed since midnight on 1 January 1970 UTC, a point in time known as the Unix epoch. This simplicity is what makes them universal across programming languages, databases, and operating systems. A timestamp of 1700000000 means the same instant everywhere in the world, regardless of timezone.
In practice, this simplicity creates a category of bugs that are difficult to catch in development but very visible in production. The most common are: treating a millisecond timestamp as a second timestamp (or vice versa), storing timestamps in local time instead of UTC, and displaying UTC timestamps without timezone conversion in user-facing interfaces. Each of these bugs is easy to introduce and sometimes hard to detect because the resulting dates are plausible-looking numbers — just wrong.
This guide covers the mechanics of epoch time, the most common mistakes and how to avoid them, and when to use an epoch converter during debugging.