Skip to content
GAMETROZ

What Is a Unix Timestamp?

Updated · 3 min read

Short answer

A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on January 1, 1970, known as the Unix epoch. Paste one into the Unix Timestamp Converter to see it as a readable date.

Why computers use a single number

Dates are awkward for software. Months have different lengths, time zones shift, and daylight saving time moves clocks forward and back. A single running count of seconds avoids all of that. It is easy to store, sort and compare, and the difference between two timestamps is simply the number of seconds between two moments.

Seconds versus milliseconds

The classic timestamp counts seconds, and has ten digits for dates around the present day. Many programming environments, including JavaScript, count milliseconds instead, which gives a thirteen-digit number. If a converted date lands in January 1970, or in a year thousands of years away, you have probably used the wrong unit.

Examples of timestamp values
TimestampUnitMeaning
0SecondsJanuary 1, 1970, 00:00:00 UTC (the epoch)
86400SecondsJanuary 2, 1970, 00:00:00 UTC (one day later)
1000000000SecondsSeptember 9, 2001, 01:46:40 UTC
1000000000000MillisecondsThe same moment as the row above

UTC and time zones

A timestamp has no time zone built in. It marks one absolute moment, the same everywhere on Earth. The time zone only matters when you display it: the same timestamp reads as different clock times in New York and in Tokyo. The converter shows both UTC and your local time, so you can see the difference.

How to convert a timestamp

  1. Open the Unix Timestamp Converter.
  2. Paste the number. Check whether it has 10 digits (seconds) or 13 (milliseconds).
  3. Read the date in UTC and in your local time zone.
  4. To go the other way, enter a date and time and copy the resulting timestamp.

The year 2038 problem

Some older systems store the timestamp as a signed 32-bit integer. The largest value it can hold is 2,147,483,647, which corresponds to January 19, 2038, at 03:14:07 UTC. One second later the number overflows and wraps to a negative value, which such a system would read as a date in 1901. Systems that use 64-bit integers are not affected on any practical time scale, and modern software has largely moved to them.

Where you will meet timestamps

  • API responses and JSON data, where created and updated fields are often timestamps.
  • Log files and database columns.
  • Authentication tokens, which often store an expiry time as a timestamp.
  • File metadata, such as when a file was last modified.

When a timestamp sits inside a JSON payload, the JSON Formatter & Validator makes the structure readable first; see How to Format, Minify and Validate JSON. Related developer utilities include the UUID Generator & Validator for unique identifiers and the Hash Generator for checksums. Our roundup Best Free Online Developer Tools covers the rest.

Negative timestamps and leap seconds

Moments before the epoch are represented by negative numbers, so a timestamp of -86400 is December 31, 1969. Unix time also ignores leap seconds: every day is treated as exactly 86,400 seconds long. For almost every application that distinction does not matter, but it explains why timestamps cannot be used for precise astronomical timekeeping.

Reading timestamps in the wild

Not every large number is a timestamp, so look for context. A field named created_at, expires or updated next to a ten-digit value is a strong hint. If the value has nine digits, it is a date before 2001, and if it has eleven or more, check whether it is in milliseconds. When in doubt, convert it and see whether the resulting date is plausible.

Quick mental estimates

A few round numbers help when you read a log. A day is 86,400 seconds, an hour is 3,600, and a week is 604,800. Adding 3,600 to a timestamp moves it forward one hour, which is a quick way to reason about expiry times without a calculator. For anything exact, paste the value into the converter instead of doing arithmetic by hand.

Tools in this guide

Unix Timestamp Converter

Convert Unix timestamps to readable dates and dates back to timestamps, in UTC and your time zone.

Developer

UUID Generator & Validator

Generate random version 4 UUIDs in bulk, or check whether a UUID is valid and which version it is.

Generators