Guide
Negative Unix timestamps and dates before 1970
Learn what a negative Unix timestamp means, how pre-epoch dates are calculated, and which storage limits to check.
by Tools in a Tab · Published on · Reviewed on
Short answer
A negative timestamp represents an instant before the Unix epoch. The minus
sign does not mean the value is corrupt; it measures backward from
1970-01-01 00:00:00 UTC.
Exact examples
| Timestamp in seconds | UTC date |
|---|---|
0 |
1970-01-01 00:00:00 |
-1 |
1969-12-31 23:59:59 |
-86400 |
1969-12-31 00:00:00 |
-2208988800 |
1900-01-01 00:00:00 |
The arithmetic is symmetric around zero. In milliseconds, the second before
the epoch is -1000; the millisecond immediately before it is -1.
Why some systems reject them
Unix time is a model, but each database, language, or protocol chooses its range. An unsigned field cannot store negatives. Older libraries and 32-bit integer formats may impose narrower boundaries. A user interface may also limit years even when its internal type could represent more.
Separate two questions:
- Does the date have a mathematically valid timestamp?
- Does the destination support that value and range?
The Unix timestamp converter supports pre-1970 dates within its documented range and checks integer scaling before creating a date object.
Historical calendars
Converting a very old date does not prove that people in that place used the same civil calendar notation at the time. Modern APIs commonly extend the Gregorian calendar backward uniformly. That is useful for technical arithmetic, while historical research may require local calendar transitions.
Recommended boundary checks
- Preserve the sign through serialization and transport.
- Declare seconds or milliseconds.
- Test
-1,0, and1at the epoch boundary. - Verify the destination storage range.
- Display the resulting UTC date as a sanity check.
Primary source
The ECMAScript time value specification defines the epoch, milliseconds, and days before it through negative values.