What is a Unix timestamp?
It's the number of seconds since January 1, 1970, 00:00 UTC — the “epoch”. Because it doesn't depend on a time zone, the same number means the same instant everywhere, which is why databases, APIs and logs often store dates this way. JavaScript and Java count in milliseconds. Systems that store the value as a signed 32-bit integer overflow on January 19, 2038, at 03:14:07 UTC: the “year 2038 problem”.
How the unit is detected
| Unit | Example |
|---|---|
| Seconds | 10 digits |
| Milliseconds | 13 digits |
| Microseconds | 16 digits |
| Nanoseconds | 19 digits |
By the number of digits: up to 11, seconds; up to 14, milliseconds; up to 17, microseconds; beyond that, nanoseconds. Click an example to try it.