A Unix timestamp counts seconds from one UTC instant
POSIX time counts SI seconds from 1970-01-01 00:00:00 UTC. Leap seconds are not inserted, so every day in the counter is exactly 86400 seconds. The number is an instant, not a wall clock.
JWT exp, iat, and nbf are that count in seconds. Read the claim in the JWT decoder. A cron schedule is a different clock: it names civil times, which you can check in the cron expression generator.
Seconds, milliseconds, and the clock you print
Where the count starts, and why leap seconds are missing
- Zero is 1970-01-01 00:00:00 UTC, not local midnight.
- A negative count is an instant before that epoch.
- Leap seconds are not inserted. Each POSIX day is 86400 seconds, so the counter can sit a few seconds away from atomic UTC.
- The count does not name a time zone. A zone is applied only when a person prints a clock.
Why a value below 1e12 is seconds and a larger one is milliseconds
- An integer whose absolute value is below 1e12 is read as seconds. 1700000000 is 2023-11-14 22:13:20 UTC.
- An integer at or above 1e12 is read as milliseconds. 1700000000000 is the same instant.
- Ten-digit values are the usual seconds form. Thirteen-digit values are the usual milliseconds form.
- JavaScript Date.now() and the Date constructor use milliseconds. Dividing by 1000 is the seconds form.
What local time, UTC, and an ISO 8601 Z each mean
- Local time prints the instant on this machine’s zone. UTC+8 shows a clock eight hours later than UTC.
- The UTC line is the same instant with the offset removed.
- ISO 8601 ending in Z is UTC. An offset such as +08:00 is a civil time with that zone written out.
- A date control is a civil clock to the second. Turning it into a count applies the local offset, and the fraction of a second is zero.
Why the same second can print two different clocks
- Daylight-saving rules move the civil clock without changing the underlying count.
- China used daylight saving in 1986–1991. From 1992, Asia/Shanghai stays at UTC+8, so a flat “plus eight hours” is wrong for some earlier instants.
- A 32-bit signed second overflows at 2147483647, which is 2038-01-19 03:14:07 UTC. That limit is the storage width, not the end of the epoch.
- SQL timestamp without time zone stores a civil clock. timestamptz stores an instant. Mixing the two shifts the reading by the session zone.
Where the unit is easy to get wrong
JWT exp
RFC 7519 NumericDate is seconds. A millisecond exp looks decades past the real expiry. Compare it with the seconds line, then open the token in the JWT decoder.
Logs and database columns
A 10-digit log field is seconds. A Java or JavaScript field is often milliseconds. A timestamp without time zone still needs the zone the writer assumed.