Skip to content

The Year 2038 Problem

Also known as the Epochalypse — the day 32-bit clocks run out of time and fall back to 1901. It is already 83% of the way here. Are you prepared?

What is the Year 2038 problem?

Deep inside almost every computer, time is kept as a single number: the count of seconds since midnight UTC on 1 January 1970, a moment engineers call the Unix epoch. Right now that number is over 1.7 billion and climbing by one every second.

The trouble is where that number is stored. Older systems keep it in a signed 32-bit integer — a box with room for values up to 2,147,483,647 and no higher. That ceiling is reached at 03:14:07 UTC on 19 January 2038. One tick later the box overflows, the number flips negative, and the clock reads December 1901. Try the Watch it overflow button above to see it happen.

Am I affected? Check a date

Pick a date or paste a timestamp and see which storage types can still hold it. Anything past January 2038 overflows a signed 32-bit field — even if that date is being stored today.

1970203821062200

Pick a date, drag the slider, or hit Now to see which storage types can still hold it.

Which storage types break in 2038?

The bug lives in the type, not the language. If your timestamps sit in any of the red rows below, they have a deadline.

Signed 32-bit int (int32 / int4) Breaks 2038
a bare epoch column, legacy time_t
Safe until 2038
MySQL TIMESTAMP Breaks 2038
MySQL / MariaDB row timestamps
Safe until 2038
32-bit time_t (C / C++) Breaks 2038
old Linux, embedded firmware
Safe until 2038
Unsigned 32-bit int (uint32) Breaks 2106
the “just make it unsigned” patch
Safe until 2106
MySQL DATETIME Safe
MySQL / MariaDB
Safe until 9999
PostgreSQL timestamptz Safe
Postgres, stored as 64-bit
Safe until 294276
64-bit int (bigint) Safe
a modern epoch column
Safe until ~292 billion
64-bit time_t (C / C++) Safe
modern Linux, glibc 2.34+
Safe until ~292 billion
Java long / Instant Safe
JVM epoch millis
Safe until 292 million
JavaScript Date / number Safe
browsers, Node.js
Safe until 275760
.NET DateTime / DateTimeOffset Safe
C#, F#, VB.NET
Safe until 9999
MongoDB Date (BSON) Safe
MongoDB documents (64-bit)
Safe until ~292 million

Is the world going to end?

No — and it is worth being calm about this. Every phone, laptop, and server built in the last decade already stores time in a 64-bit integer, which does not overflow until roughly the year 292 billion. The lights will stay on.

The danger is narrower and more stubborn: devices that are rarely or never updated. Industrial controllers, medical hardware, cars, routers, point-of-sale terminals, and embedded chips can outlive their makers, and many still run 32-bit time. Those are the systems worth auditing before the deadline — not out of panic, but because they are hard to reach once deployed.

What actually breaks in 2038?

It isn't hypothetical, and it isn't only a 2038 story — the failure appears the moment a vulnerable system has to handle a date past the limit:

  • Future dates stored today. A 30-year mortgage, a long-dated bond, an insurance or pension policy maturing in the 2050s — anything that writes a post-2038 date into a 32-bit field fails now, not in 2038. This is where the bug bites first.
  • It has already happened. In 2006 a widely-used web server shipped with a default session timeout set so far in the future that it overflowed to a negative number — so sessions expired the instant they were created. A textbook 2038 bug, decades early.
  • Long-lived hardware. Industrial and medical controllers, cars, routers, and point-of-sale terminals are often built once and rarely patched — and many still keep time in 32 bits. Those are the systems worth auditing early, because you can't always reach them later.

How is it different from Y2K?

Y2K was a formatting problem: years were written with two digits, so “00” was ambiguous. It was fixable by changing how dates were stored and displayed. The Year 2038 problem is a physical limit — the integer is only 32 bits wide — and that width is frozen into compiled programs, network protocols, and file formats. You cannot reformat your way out; the type has to grow to 64 bits and the software rebuilt.

The cousins are worth knowing too: reinterpreting the field as unsigned only buys time until 2106, and other epochs have their own limits — NTP rolls over in 2036, while Windows FILETIME sidesteps the problem entirely by counting in 64 bits.

Why not just use unsigned integers?

It is the tempting shortcut, and it is a trap. Reinterpreting the same 32 bits as unsigned doubles the ceiling to 4,294,967,295 seconds — but that still runs out on 7 February 2106, and it throws away every date before 1970, which needs negative numbers. You would spend real engineering effort to move the cliff by 68 years instead of removing it. Sixty-four-bit time is the fix that actually ends the problem.

How do I fix it — and how do I prepare?

For almost everyone, the honest answer is: nothing. Your phone, laptop, and the services you rely on are already 64-bit and update themselves. If you build or run software, a short checklist heads off the surprises:

  • Store time in 64 bits everywhere int64 / bigint. This is the real fix; it moves the ceiling roughly 292 billion years out.
  • Rebuild 32-bit software against a 64-bit time_t — the Linux kernel (5.6+) and glibc (2.34+) default to it.
  • Pick the right column type — prefer DATETIME or timestamptz over MySQL's 32-bit-limited TIMESTAMP.
  • Test with future dates now. Push a post-2038 date through your system — the checker higher up this page shows which storage types survive — to surface failures while they're cheap to fix.

Frequently asked questions

When exactly does the Year 2038 problem happen?

At 03:14:07 UTC on Tuesday, 19 January 2038. That is the moment a signed 32-bit integer counting seconds since 1 January 1970 reaches its maximum value, 2,147,483,647. One second later it overflows.

Why does the date jump back to 1901?

A signed 32-bit integer uses its top bit for the sign. When the value ticks one past the maximum, that bit flips and the number becomes the most-negative value, −2,147,483,648. Counted from 1970, that lands on 13 December 1901 — so an affected system suddenly thinks it is 136 years in the past.

Am I affected?

Almost certainly not on your phone or laptop — everything made in the last decade uses 64-bit time, which is safe for hundreds of billions of years. The real risk is in long-lived, rarely-updated systems: embedded devices, industrial and medical hardware, old databases, and any code that still stores time in a 32-bit field. You can also be bitten today if software stores a future date past 2038 (a loan maturity, a certificate expiry) in a 32-bit column.

Is this the same as the Y2K bug?

No. Y2K was a formatting problem — years stored as two digits (“99”) — that could be fixed in the data. The Year 2038 problem is a hard limit of how wide the integer is, baked into APIs, file formats, and firmware. It cannot be fixed by reformatting; the storage type itself has to change to 64-bit.

Can't we just switch to an unsigned 32-bit integer?

That only delays the problem to 7 February 2106, and it breaks the ability to store dates before 1970 (which need negative values). It is a patch, not a fix. The correct solution is a 64-bit integer, which pushes the limit roughly 292 billion years into the future.

Can the Year 2038 problem cause bugs before 2038?

Yes — this is the part people miss. Any system that calculates or stores a date after 19 January 2038 can fail right now. A 30-year mortgage signed today matures in the 2050s; a TLS certificate or subscription set far in the future; a scheduled job planned years out — all overflow a 32-bit field the moment they are stored, not in 2038.

How do I fix the Year 2038 problem?

Store time in 64-bit integers everywhere (int64 / bigint), rebuild 32-bit software against a 64-bit time_t, prefer database types like DATETIME or timestamptz over 32-bit-limited ones like MySQL TIMESTAMP, and test your system with dates past 2038 to flush out the failures early.

Related tools

Smart paste

Paste any timestamp or date, or search for a tool