The exact moment

A signed 32-bit integer holds values up to 2,147,483,647. As a Unix timestamp, that is 2038-01-19T03:14:07Z. One second later, the value becomes -2,147,483,648, which many systems interpret as 1901-12-13. The result is not a crash but a wrong date, which can corrupt ordering, expiry and retention logic silently.

text
2^31 - 1 = 2147483647  → 2038-01-19T03:14:07Z
2^31     = 2147483648  → overflow for signed 32-bit

Where 32-bit time still lives

  • Embedded Linux devices and routers with 32-bit time_t.
  • Old databases and file formats that store timestamps in 32-bit fields.
  • Legacy APIs that serialize time as a signed 32-bit integer.
  • Some filesystems on 32-bit kernels, depending on build options.
  • Binary protocols with fixed-width timestamp fields (often milliseconds, which overflowed in 1970).

64-bit Linux with a modern libc is already safe: time_t is 64-bit even on some 32-bit ABIs via _TIME_BITS=64.

How to audit

Search schemas and code for int32, int, time_t, timestamp columns and serialized fields. Then test at the boundary: set a fake clock to 2038-01-19T03:14:08Z in a staging environment and watch what breaks. A code search alone will miss dynamically typed fields and third-party binaries.

  • Grep for 32-bit timestamp declarations and casts.
  • Check database column types; MySQL TIMESTAMP has its own 2038 limit in many builds.
  • Check JWT, session and cache expiry code that adds seconds to now.
  • Test embedded firmware update paths separately; they often ship their own libc.

Fixes and non-fixes

The real fix is to widen the storage and the ABI to 64-bit. Multiplying by 1000 and storing milliseconds in a 64-bit integer is a common migration, but it changes every consumer of the field and must be coordinated. Shifting the epoch (for example, counting from 2000) is a hack that breaks interoperability and should be avoided.

On the client side, JavaScript numbers are IEEE-754 doubles and remain exact for millisecond timestamps until the year 287396, so browsers are not the problem. The risk is in servers, embedded devices, and serialized data.

If a vendor cannot tell you whether their firmware uses 64-bit time, assume it does not and plan a replacement before 2038.