§ 8.1Seconds, milliseconds, or more?
| Digits today | Unit | Typical source |
|---|---|---|
| 10 | seconds | Unix, PHP time(), Python int(time.time()), JWT |
| 13 | milliseconds | JavaScript Date.now(), Java currentTimeMillis() |
| 16 | microseconds | PostgreSQL internals, some logs |
| 19 | nanoseconds | Go UnixNano(), InfluxDB |
We detect the unit from the size of the number. A date in 1970 when you expected this year almost always means milliseconds were read as seconds.
§ 8.2Time zones
A Unix timestamp has no time zone — it counts seconds since 1970-01-01 00:00:00 UTC. The same timestamp is shown in UTC and in your device’s local time above. Store timestamps or UTC; convert to local time only for display.
§ 8.3The year 2038
A signed 32-bit integer holding seconds runs out at 2,147,483,647 — 03:14:07 UTC on 19 January 2038. Systems that still store time in 32 bits will wrap around to 1901. Use 64-bit integers for timestamps.
§ 8.4Get the current timestamp
JavaScript Math.floor(Date.now() / 1000)
Python int(time.time())
Go time.Now().Unix()
PostgreSQL SELECT extract(epoch FROM now());
MySQL SELECT UNIX_TIMESTAMP();
Shell date +%s
§ 8.QQuestions
Does Unix time count leap seconds?
No. Unix time treats every day as exactly 86,400 seconds, so leap seconds are not counted.
Can timestamps be negative?
Yes — negative values are dates before 1970.
§ 8.RReferences
Last reviewed 2026-10-14.