1. Home
  2. Guides
  3. Unix timestamps explained: seconds, milliseconds and time zones
Developer

Unix timestamps explained: seconds, milliseconds and time zones

What epoch time is, how to read it, and the mistakes that shift dates.

12 October 20265 min read

A Unix timestamp, also called epoch time, is a single number that identifies a moment: the number of seconds since 00:00:00 UTC on 1 January 1970. Databases, APIs, logs and tokens use it because one number is easy to store, sort and compare, and it does not depend on a time zone.

Reading a timestamp

0            → 1 Jan 1970, 00:00:00 UTC
1700000000   → 14 Nov 2023, 22:13:20 UTC
86400        → exactly one day after the epoch

Each day adds 86,400 seconds. Leap seconds are ignored, so every day is treated as exactly that long.

Convert a timestamp to a date, or a date to a timestamp, in any time zone.Open Unix Timestamp Converter →

Seconds or milliseconds?

The most common surprise is the length of the number:

DigitsUnitSeen in
10 (1700000000)SecondsUnix, PHP, Python time.time(), JWT exp and iat
13 (1700000000000)MillisecondsJavaScript Date.now(), Java, many APIs
16 / 19Micro / nanosecondsDatabases, Go, tracing tools

If a converted date lands in January 1970, you gave milliseconds to something expecting seconds. If it lands thousands of years in the future, you did the opposite.

Time zone traps

  • A timestamp has no time zone. It is always the same instant everywhere. Only the display changes: 1700000000 is 22:13 UTC and 03:43 the next day in India (IST, UTC+5:30).
  • Store and compare timestamps; convert to local time only to show them to a person.
  • Daylight saving makes “every day at 9:00” and “every 24 hours” different things. See cron expressions for schedules.

The year 2038 problem

Older systems store the timestamp in a signed 32-bit number, which runs out at 03:14:07 UTC on 19 January 2038 (timestamp 2,147,483,647). After that it wraps to a negative number, which reads as 1901. Modern systems use 64 bits, which lasts for billions of years, but embedded devices and old databases may still need attention.

Where you will meet them

  • JSON Web Tokens: exp and iat in seconds; decode them with the JWT Decoder.
  • API responses and webhooks, log files and file systems.
  • Database columns, where integer timestamps are fast to index.

The Epoch Converter accepts seconds, milliseconds and human dates side by side.

Frequently asked questions

Why 1 January 1970?

It was a convenient recent date when Unix was being designed in the early 1970s. It became the standard starting point.

Can a timestamp be negative?

Yes. Negative values are moments before 1970, for example −86400 is 31 December 1969.

More guides

Free for everyone, kept free by you.

No paywall, no sign-up and no watermarks. If a tool saved you time, you can chip in any amount by UPI to keep Nova Free Tools running.

Esc
↑↓ move↵ openEsc close