What is a Unix timestamp
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds elapsed since midnight on January 1, 1970 in UTC. That instant is known as the epoch. It is the most common way to represent time in computer systems because it is a single number, with no ambiguity around time zones or regional date formats.
Key epoch facts
Quick reference table with the facts people look up most:
| Concept | Value |
|---|---|
| Epoch 0 | 1970-01-01T00:00:00Z (UTC) |
| Timestamp in seconds | 10 digits (e.g. 1700000000) |
| Timestamp in milliseconds | 13 digits (e.g. 1700000000000) |
| Example: 1700000000 s | 2023-11-14T22:13:20Z |
| Y2038 limit (32-bit) | 2038-01-19T03:14:07Z (2,147,483,647) |
| ISO 8601 format | YYYY-MM-DDTHH:MM:SSZ (Z = UTC) |
Seconds vs milliseconds
There are two widely used conventions. The original Unix one counts in seconds (10 digits today, e.g. 1700000000). JavaScript, however, works in milliseconds (13 digits, e.g. 1700000000000). Mixing them up is the most common mistake: if you treat milliseconds as seconds, you get a date in the year 56,000. This tool detects the unit by digit count, but you can force it with the selector.
UTC and local time
A timestamp represents an absolute instant, always in UTC. To show it to a person you convert it to their time zone. That is why we give you both views: the ISO 8601 in UTC (ending in Z) and your device's local time. If you work with server logs across regions, always store UTC and convert only when displaying.
The ISO 8601 format
ISO 8601 is the standard for writing dates as unambiguous text: 2023-11-14T22:13:20Z. It starts with the year, then month and day, the T separates date from time, and the Z marks UTC (Zulu). Its big advantage is that it sorts alphabetically the same way it sorts chronologically, ideal for APIs, databases and files.
The Year 2038 problem
Many older systems store the timestamp in a signed 32-bit integer. That type maxes out at 2,147,483,647, a value reached on January 19, 2038 at 03:14:07 UTC. Past that point the counter overflows and jumps to negative dates (1901). The fix, already adopted on most modern platforms, is to use 64-bit integers, which leave room for billions of years.
Common uses
- Databases: store
created_atandupdated_atas epoch to compare and sort fast. - APIs and JWT: the
iatandexpfields of a token are timestamps in seconds. - Logs: correlate events across services using a shared clock in UTC.
- Cache and expiry: check whether something expired by comparing
nowagainst a stored epoch. - Cron and scheduling: define when a task should run without time-zone headaches.