What is Unix time?
Unix time counts the seconds that have passed since midnight UTC on 1 January 1970, a moment known as the Unix epoch. It is a single number with no time zone attached, which makes it easy to store, sort and compare. Moments before 1970 are negative numbers.
Many systems use a finer unit: JavaScript and Java usually work in milliseconds, some databases and tracing tools use microseconds, and Go and Linux kernels often report nanoseconds. This converter guesses the unit from the number of digits, and you can override the guess.
Unix time ignores leap seconds. Every day is treated as exactly 86,400 seconds long, so when a leap second is added to UTC, the Unix clock simply repeats or smears a second instead of counting it.
Seconds in common durations
| Duration | Seconds | Copy |
|---|---|---|
| 1 minute | 60 | |
| 1 hour | 3,600 | |
| 1 day | 86,400 | |
| 1 week | 604,800 | |
| 1 month30.44 days on average | 2,630,016 | |
| 1 year365.24 days on average | 31,556,736 |
The year 2038 problem
Older software often stores Unix time in a signed 32-bit integer. The largest value that fits is 2147483647, which is 03:14:07 UTC on 19 January 2038. One second later the counter wraps around to a large negative number, and those systems suddenly think it is December 1901. Modern platforms use 64-bit integers, which push the limit billions of years away, but embedded devices, old file formats and database columns can still be affected.
Unix time in code
How to read the current timestamp and turn a timestamp back into a date in popular languages.
Current timestamp
// Seconds (Date.now() returns milliseconds)
const seconds = Math.floor(Date.now() / 1000);Timestamp to date
const date = new Date(1700000000 * 1000);
date.toISOString(); // "2023-11-14T22:13:20.000Z"