A Unix timestamp is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, a moment known as the Unix epoch. Instead of a calendar date, programs store time as a single integer such as 1767225600, which is trivial to compare, sort and add to.
Why 1970?
When the Unix operating system was built, its designers needed one fixed reference point that was recent enough to be useful and early enough not to be in the future. Midnight UTC on 1 January 1970 was chosen. Every timestamp is a signed count from that instant, so a value of 0 means the epoch itself.
Seconds vs milliseconds
The classic Unix timestamp counts seconds, but many modern systems use milliseconds to gain precision. That difference trips people up constantly:
| Value | Unit | Roughly when |
|---|---|---|
| 1767225600 | seconds | 1 January 2026 |
| 1767225600000 | milliseconds | 1 January 2026 |
| 0 | either | 1 January 1970 (the epoch) |
If a converted date lands in 1970 or in the far future, you almost certainly have the unit wrong. A millisecond value is a thousand times larger, so dividing or multiplying by 1,000 fixes it.
From a human date to a timestamp
Pick a moment and count the seconds since the epoch. For example, 1 January 2026 at 00:00 UTC is 1767225600. A later moment has a larger number; an earlier one has a smaller (or negative) number. In JavaScript, Math.floor(Date.now() / 1000) gives the current seconds, while Date.now() alone gives milliseconds.
Your timezone is not part of the value
A timestamp is always measured from UTC, so the same integer is the same instant everywhere on Earth. The timezone only enters when you display it: 1767225600 is midnight in London and 7:00 pm on 31 December 2025 in New York. Two people in different places can read the same stored value and see different wall-clock times.
Where timestamps are used
- Databases: recording when a row was created or updated.
- Logs: ordering events exactly, across machines.
- APIs: passing expiry times for tokens and sessions.
- Caches: deciding whether a stored copy is still fresh.
The year 2038 problem
Systems that store the timestamp as a signed 32-bit integer can only count up to 2,147,483,647 seconds, which runs out on 19 January 2038. After that the value overflows into a negative number and wraps back to 1901 unless the system uses a 64-bit integer. Most modern software already does, but older or embedded devices may not.
Converting either direction
Converting by hand is error-prone, especially across timezones. Paste a number into our timestamp converter to see the human-readable date in UTC and your local time, or enter a date to get the timestamp back. If you are moving structured data around, the JSON vs CSV guide explains how those timestamps typically appear in each format.