Maximum Unix Timestamp Values

What are the maximum Unix timestamp values for 32-bit and 64-bit systems? Learn the limits, when they overflow, and how to future-proof your code.

Concept

2^31 - 1 / 2^63 - 1

Detailed Explanation

The maximum Unix timestamp value depends on the integer size used to store it. On 32-bit systems, the signed integer maximum is 2,147,483,647 (2^31 - 1), corresponding to January 19, 2038 at 03:14:07 UTC. On 64-bit systems, the maximum is 9,223,372,036,854,775,807 (2^63 - 1), which corresponds to approximately 292 billion years in the future — long after the Sun has burned out.

Maximum values by storage type:

Signed 32-bit:    2,147,483,647       → 2038-01-19 03:14:07 UTC
Unsigned 32-bit:  4,294,967,295       → 2106-02-07 06:28:15 UTC
Signed 64-bit:    9,223,372,036,854,775,807 → ~292 billion years

Millisecond timestamps shrink the range:

When storing milliseconds instead of seconds, the usable range of a 64-bit integer is 1000x shorter — but still about 292 million years, which is effectively unlimited for all practical purposes. However, for a 32-bit integer, millisecond timestamps overflow in just 24.8 days, making them completely impractical at 32-bit width.

Per-language maximums:

JavaScript:  Number.MAX_SAFE_INTEGER = 2^53 - 1 (ms)
             → ~285,616 years from epoch
Python:      Arbitrary precision integers, no limit
Java:        long = 2^63 - 1 (ms with Instant)
             → ~292 million years
Go:          int64, nanoseconds internally
             → ~292 years from epoch (nano), unlimited (seconds)

JavaScript's unique situation: JavaScript uses 64-bit floats for numbers. The maximum safe integer (Number.MAX_SAFE_INTEGER = 9,007,199,254,740,991) means millisecond timestamps are safe for about 285,000 years. Beyond that, precision loss occurs. In practice, this is not a concern.

Database limits:

MySQL's TIMESTAMP type caps at 2038. PostgreSQL's timestamptz supports up to 294,276 AD. MongoDB stores timestamps as 64-bit values. When choosing storage, always check the maximum supported date, especially if you are storing future-dated records like subscription expirations or bond maturity dates.

Future-proofing: Always use 64-bit timestamps. If your infrastructure still has 32-bit components, audit and upgrade them before 2038.

Use Case

Financial applications storing bond maturity dates or insurance policy expirations decades in the future must verify that their timestamp storage can represent dates well beyond 2038.

Try It — Timestamp Converter

Open full tool