What Is a Unix Timestamp?
A Unix timestamp is a single number: the count of seconds since midnight UTC on 1 January 1970, not counting leap seconds. It is how most computers store a moment in time, because one integer is easier to sort, compare and transmit than a date with a time zone attached.
The definition
The epoch is 1 January 1970 at 00:00:00 UTC. A timestamp of 0 means that instant. A timestamp of 1,700,000,000 means about 1.7 billion seconds later, which is in November 2023.
Negative timestamps exist for dates before 1970, and they behave the same way: −86,400 is one day before the epoch.
Convert a timestamp to a date and back.
Open the Unix Timestamp Converter →Why 1970
The date was chosen when the Unix operating system was being built in the early 1970s. It was a round, recent date that made the numbers small enough for the hardware of the time, and it was before any system that needed to be represented.
There is nothing special about the date itself. It is a convention, and it stuck because so much software was built on it.
Time zones do not exist in the number
A timestamp is an absolute instant. Two people in Cairo and Los Angeles looking at the same timestamp are looking at the same moment, and each sees a different local clock time when it is converted.
This is the main advantage: there is no ambiguity about daylight saving or offsets, because the offset is applied only when the timestamp is turned into text for a human.
Seconds, milliseconds and microseconds
| Unit | Digits for a 2026 date | Example use |
|---|---|---|
| Seconds | 10 | Most Unix systems, APIs, databases |
| Milliseconds | 13 | JavaScript, many web APIs |
| Microseconds | 16 | Some databases and high-resolution logs |
Passing seconds where milliseconds are expected puts the date in 1970, and the reverse lands you tens of thousands of years in the future. When a converted date looks absurd, the unit is almost always the reason.
Where you meet them
- Database rows with a created_at integer column.
- Log files that record events with a numeric time.
- APIs that return expiry times and issued-at times in seconds.
- JWT tokens, where iat and exp are numeric.
- File metadata on some systems.
Leap seconds
Unix time ignores leap seconds. The count assumes every day is exactly 86,400 seconds, so the number does not jump when a leap second is inserted. For almost all software this is invisible, and it is one reason the format is simple.
Systems that need to represent leap seconds precisely use other time scales, which is a specialist concern outside normal application work.
Reading one by eye
A timestamp near 1.7 billion is late 2023. Each year adds about 31.5 million seconds. That is enough to place a timestamp within a year or so without a converter, which is handy when scanning logs.
For exact values, use a converter. Mental arithmetic on ten digits is not reliable.
Why the number is not going away
It is compact, sortable, timezone-free and supported everywhere. Newer formats such as RFC 3339 strings are more readable but longer and easier to get wrong. Most systems store a timestamp and format it for display.
The main risk is the 32-bit overflow in 2038, covered separately, which affects systems that still store the count in a signed 32-bit integer.
A practical note
When you store a time, store the instant, not the local clock reading. Convert to local time only when you display it. That single rule prevents most time zone bugs in applications.
Storing time in a database
A timestamp column is compact, sortable and timezone-free, which is why it is a common default. The trade-off is that every query and every report has to convert it, and the conversion is where time zone errors creep in.
Many teams store a timestamp for machine use and an ISO string for display, or configure the database to return timestamptz. Either works; the rule is to keep one authoritative representation and convert only at the edges.
Frequently asked questions
Is a Unix timestamp in seconds or milliseconds?
Both are used. Ten digits is usually seconds, thirteen is usually milliseconds.
Does a timestamp include a time zone?
No. It is an absolute instant. The time zone is applied when you format it.
What is the timestamp for 1 January 1970?
Zero, by definition, in UTC.