DevToolbox
Converters5 min read

Unix timestamps explained: epoch, UTC, and ISO 8601

Unix timestamps are how most systems store a moment in time, but they trip people up: seconds versus milliseconds, the role of UTC, and the looming Year 2038 problem. This guide explains what a timestamp is, how it relates to human dates and time zones, and the formats you will meet. Convert any timestamp both ways with the Timestamp Converter.

What a Unix timestamp is

A Unix timestamp is the number of seconds since the Unix epoch — 00:00:00 UTC on 1 January 1970. It is a single integer that names an exact instant, with no time zone attached, which is why databases, logs, and APIs use it to store time unambiguously.

Seconds vs milliseconds

Some systems count seconds and others count milliseconds, which are a thousand times larger. Today a seconds timestamp is about ten digits and a milliseconds timestamp about thirteen. Mixing them up is a common bug — a milliseconds value read as seconds lands tens of thousands of years in the future.

FormatExampleRepresents
Seconds17000000002023-11-14 22:13:20 UTC
Milliseconds1700000000000the same instant

Timestamps and time zones

A Unix timestamp always refers to an instant in UTC. Time zones only change how that instant is displayed as a local clock time — the same timestamp shows as different wall-clock times in New York and Tokyo, but it is the same moment. Storing timestamps rather than local times avoids a whole category of time-zone bugs.

ISO 8601

ISO 8601 is the standard text format for dates and times, such as 2023-11-14T22:13:20Z, where the trailing Z means UTC. APIs favor it because it is human-readable, unambiguous, and sorts correctly as plain text. The Timestamp Converter shows the ISO string alongside the numeric timestamp.

The Year 2038 problem

Systems that store Unix time in a signed 32-bit integer can only count to 03:14:07 UTC on 19 January 2038, after which the value overflows to a negative number. Modern platforms use 64-bit timestamps, which push the limit billions of years out, but the boundary still matters when working with older systems and embedded devices.

Frequently asked questions

What is the Unix epoch?+

The reference instant for Unix time: 00:00:00 UTC on 1 January 1970. A timestamp counts the seconds elapsed since then.

Is a Unix timestamp in seconds or milliseconds?+

Both are used. A seconds timestamp is about ten digits today; a milliseconds timestamp is about thirteen. Always confirm which a system uses.

Does a Unix timestamp include a time zone?+

No. It is always UTC. Time zones only affect how the instant is displayed as a local time.

What is the Year 2038 problem?+

Signed 32-bit timestamps overflow on 19 January 2038. Modern 64-bit timestamps avoid it, but older systems can still be affected.

Try it now

Put this into practice with the free, in-browser tool: