Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

The Year 2038 problem

On this page
  1. What overflows, exactly
  2. The exact moment
  3. What’s affected
    1. Definitely safe (64-bit time_t)
    2. Potentially affected (32-bit time_t)
    3. Definitely affected (without action)
  4. Real incidents already
  5. How to check your stack
  6. Languages that handle it natively
  7. What to do today
  8. Tools
  9. Related reading
  10. Related across the network

TL;DR. On 2038-01-19 03:14:07 UTC, the signed 32-bit Unix timestamp overflows from 2147483647 to -2147483648, making the system think it’s 1901. Most modern Linux/Unix systems already use 64-bit time_t, but embedded systems, old databases, file formats, and protocols may still be 32-bit. Audit now.

What overflows, exactly

A signed 32-bit integer holds values from -2147483648 to +2147483647. For Unix seconds, that range covers:

-2,147,483,648 = 1901-12-13 20:45:52 UTC
 0             = 1970-01-01 00:00:00 UTC (the epoch)
 2,147,483,647 = 2038-01-19 03:14:07 UTC

At the moment of 2147483647 + 1, the value wraps to -2147483648 — the system interprets the new “now” as 1901-12-13 20:45:52 UTC.

The exact moment

Tuesday, January 19, 2038 at 03:14:07 UTC
= Monday, January 18, 2038 at 22:14:07 EST
= Tuesday, January 19, 2038 at 12:14:07 JST

You can paste 2147483647 into the converter and see the date yourself.

What’s affected

Definitely safe (64-bit time_t)

For these, Y2038 is a non-issue. The 64-bit range covers ~292 billion years — well past any practical horizon.

Potentially affected (32-bit time_t)

Definitely affected (without action)

Real incidents already

The Year 2038 problem has already caused at least one real failure. In May 2006, some AOLserver web servers began hanging or crashing at around 9:25 p.m. US Eastern on May 12, in the early hours of May 13 UTC. Many of these servers had database timeout settings (MaxOpen and MaxIdle) of one billion seconds, a value commonly used to mean “never time out”. That was one billion seconds before 03:14:08 UTC on January 19, 2038, the first second a signed 32-bit Unix time cannot hold. Adding one billion seconds to the current time produced a number too large for a signed 32-bit integer. It wrapped to a negative value. On Solaris the server crashed, and on Linux its scheduled tasks stopped running. Setting the timeouts to 0 or to a modest value such as 3600 seconds, then restarting the server, fixed it. Only servers with those settings were affected, which shows how a 2038 bug can appear decades early whenever software adds a large offset to the current time.

Sources: Dossy Shiobara on the AOLserver list, May 17, 2006, Michael A. Cleverly’s explanation and Dossy Shiobara’s round-up, August 9, 2006.

Code that sets dates years ahead, such as expiry, licence or audit dates, can fail long before 2038.

How to check your stack

# C check
cat <<'EOF' > t.c
#include <stdio.h>
#include <time.h>
int main(void) {
    printf("sizeof(time_t) = %zu\n", sizeof(time_t));
    return 0;
}
EOF
gcc t.c -o t && ./t
# Want: 8

# Database — Postgres
\d+ table_name
# Look for timestamp / bigint columns; INTEGER on time fields is suspect

# Application code — search for hard-coded 2147483647 or 0x7FFFFFFF
grep -r 2147483647 .
grep -r 0x7FFFFFFF .

If your timestamps are stored as 32-bit anywhere, plan a migration to 64-bit before 2038. The fix is mechanical (column type change + data copy) but disruptive in production.

Languages that handle it natively

If your application code is in any of these on a 64-bit OS, you can ignore Y2038 for application-level time. The risk lives in:

  1. Stored data (database column types)
  2. External systems (embedded devices, legacy mainframes)
  3. Wire protocols (any that hardcode a 32-bit timestamp field)

What to do today

Tools

Paste these into the Unix timestamp converter to see for yourself. For the value ticking right now, open Current Unix timestamp (live).