Time systems, calendar references, and timezone tools.

Developer concept

What Is Unix Time?

Unix time is one of the most common machine-readable ways to represent a moment. It turns time into a single number, which makes storage and comparison easy but also creates a few familiar traps.

The core idea

Unix time counts elapsed seconds from January 1, 1970 at 00:00:00 UTC. Instead of storing year, month, day, hour, minute, and second separately, a system can store one integer and interpret it later.

That design is efficient because computers are good at comparing numbers. If one timestamp is larger than another, it happened later. Databases, APIs, logs, and operating systems all benefit from that simplicity.

Why developers still rely on it

Unix time travels well between systems because it is timezone-neutral at the storage layer. A backend can save a timestamp in UTC seconds, and the frontend can render it in Tokyo, New York, or Madrid without changing the recorded moment.

It also works naturally with interval calculations. Subtracting one Unix timestamp from another gives you elapsed seconds directly, which is far easier than subtracting two formatted date strings.

The common mistakes

The most common bug is mixing seconds and milliseconds. Many APIs, databases, and shells use seconds, while JavaScript often uses milliseconds. A value with the wrong unit will usually land in 1970 or far in the future.

Another mistake is forgetting that Unix time is usually paired with UTC semantics. The number is not local to New York, London, or your laptop. The local interpretation happens later, when the timestamp is formatted for display.

Put it into practice

Use these tools to apply what this guide covers.

Continue learning

Move laterally into the adjacent concepts that support the same family of date-and-time questions.