Skip to content

Unix timestamps explained: seconds, milliseconds and time zones

By Priyabrata Saha · Published 4 November 2026

Short answer

A Unix timestamp counts seconds since 1 January 1970 UTC. Ten digits usually means seconds and thirteen means milliseconds. The number itself has no time zone; only the way you display it does, so compare times in UTC.

What the number means

Unix time is a count of seconds since midnight UTC on 1 January 1970, a moment called the epoch. 1767225600 is exactly 1 January 2026 at 00:00 UTC. Because it is a single number, it is easy to store, sort and compare, which is why logs, databases and APIs use it everywhere.

Unix time ignores leap seconds, so every day is treated as exactly 86,400 seconds. For everyday use that makes no visible difference.

Seconds or milliseconds?

The most common timestamp bug is mixing up the two units. Most server languages and databases use seconds. JavaScript’s Date.now() and many browser APIs use milliseconds, which makes the number a thousand times larger.

For current dates, a value in seconds has ten digits and a value in milliseconds has thirteen. Reading milliseconds as seconds gives a date tens of thousands of years in the future; reading seconds as milliseconds gives a date in January 1970. If you see either, you have the unit wrong. Unix Timestamp Converter detects the unit from the length of the number and tells you which one it assumed.

Time zones

A timestamp describes one instant, the same everywhere in the world. Time zones only matter when you turn it into a wall-clock time. 1767225600 is 00:00 on 1 January in London, 19:00 on 31 December in New York and 05:30 on 1 January in Kolkata.

When two systems disagree by a whole number of hours, the cause is almost always a time zone rather than a bug in the data. Compare both values in UTC first. Unix Timestamp Converter shows UTC and your local time side by side, and Timezone Converter shows one moment in several places, including daylight-saving changes.

ISO 8601: the readable alternative

When people need to read dates, the ISO 8601 format is the safer choice: 2026-01-01T00:00:00.000Z. The Z means UTC. It sorts correctly as text, and unlike 01/02/2026 it cannot be read as either January or February depending on the reader’s country.

Checking a token’s expiry

JSON Web Tokens store their expiry in an exp claim, as Unix seconds. When an API suddenly returns 401 Unauthorized, decode the token in JWT Decoder and compare exp with the current time. If it is in the past, the token has expired and needs refreshing; the API is probably fine.

The year 2038 problem

Systems that store Unix time in a signed 32-bit integer can count up to 2,147,483,647, which is 03:14:07 UTC on 19 January 2038. One second later the value overflows. Modern operating systems and languages use 64-bit values and are not affected, but older embedded systems, file formats and database columns can be. If you design a schema today, store timestamps in a 64-bit column.

Quick reference

  • 10 digits: seconds. 13 digits: milliseconds.
  • 0 is 1970-01-01T00:00:00Z.
  • 1767225600 is 2026-01-01T00:00:00Z.
  • 2147483647 is the largest signed 32-bit value: 2038-01-19T03:14:07Z.
  • Add 86,400 to move forward one day in seconds.

Tools used in this guide