Try the Timestamp Converter

Y2K, Y2K38, and Excel's 1900 Leap Year Bug: The Dates That Break Software

Y2K cost $300–600 billion to mitigate. The Unix 2038 problem will overflow signed 32-bit timestamps on 19 January 2038. Excel has counted 29 February 1900 as a real date since the 1980s. Here's the structural causes of each date bug and which ones are still ticking.

By sadiqbd Β· June 16, 2026

Share:
Y2K, Y2K38, and Excel's 1900 Leap Year Bug: The Dates That Break Software

Y2K was real, the Unix 2038 problem is coming, and Excel has been miscalculating dates since 1900

Software history is littered with date and time bugs that required years of preparation to fix, billions of dollars to mitigate, and in some cases still lurk quietly in production systems. Understanding the structural causes β€” fixed-width date storage, epoch choices, calendar peculiarities β€” explains why these bugs happen and which ones are still ticking.


Y2K: the bug that wasn't quite a disaster

The Y2K bug (Year 2000 problem) arose because early programmers stored years as two digits to save storage space: "1998" became "98." When 2000 arrived, "00" was ambiguous β€” was it 1900 or 2000?

Why two-digit years: In the 1960s–80s, storage was expensive. A two-digit year field saved a byte per record. When you have millions of records on magnetic tape, bytes matter. The decision made economic sense at the time; the consequences were deferred.

The scale: by 1999, it was estimated that 300 billion lines of COBOL code existed globally, much of it containing two-digit years. The remediation effort was massive: the US federal government alone spent $8.5 billion; global spending estimates range from $300–600 billion.

What actually failed on 1 January 2000: comparatively little, because of the remediation effort. Notable incidents:

  • US nuclear plant radiation monitoring systems reported "no time stamp" for 2 hours
  • Japanese nuclear plants had Y2K-triggered alarms but no safety implications
  • Some US state DMVs issued driving licences with expiry dates of "1900"
  • A few hundred small business point-of-sale systems failed

The unfixed remainder: some systems that were "patched" used a windowing technique β€” dates from 00–29 treated as 2000–2029; dates from 30–99 treated as 1930–1999. These systems will encounter ambiguity when 2030 arrives.


The Unix 2038 problem (Y2K38)

Unix time is stored as a signed 32-bit integer counting seconds since 1 January 1970 00:00:00 UTC (the Unix epoch). The maximum value of a signed 32-bit integer is 2,147,483,647 β€” which corresponds to:

Tuesday, 19 January 2038, 03:14:07 UTC

At that moment, adding one second causes the counter to overflow to βˆ’2,147,483,648, which represents Friday, 13 December 1901, 20:45:52 UTC β€” a jump backwards 136 years.

The scope: any system storing time_t as a 32-bit signed integer is affected. This includes:

  • Older embedded systems (routers, industrial controllers)
  • Systems with 32-bit time_t compiled before the fix
  • File systems that store modification times as 32-bit values
  • Some databases with 32-bit Unix timestamp columns
  • 32-bit Linux kernels (which are still deployed in embedded systems)

The fix: migrate to 64-bit time_t. A signed 64-bit integer can represent dates to approximately the year 292 billion CE β€” safely beyond any realistic concern. 64-bit Linux systems made this transition; the remaining risk is legacy 32-bit embedded hardware that cannot be updated.

Timeline: Y2K38 is 14 years away as of 2024. Preparations are underway but less urgently than Y2K was addressed in the 1990s.


The Excel 1900 leap year bug

Excel stores dates as the number of days since 1 January 1900. Day 1 = 1 January 1900. This is harmless β€” but Excel also treats 1900 as a leap year, counting 29 February 1900 as day 60.

The problem: 1900 was not a leap year. The Gregorian calendar rule: years divisible by 4 are leap years, except years divisible by 100, unless also divisible by 400. 1900 Γ· 100 = 19 (exact), not divisible by 400 β†’ not a leap year.

Why it was left unfixed: Lotus 1-2-3 (Excel's predecessor) had this bug in 1-2-3 1.0. When Excel was first released, intentionally replicating the bug ensured that Lotus 1-2-3 spreadsheets imported into Excel would have matching date serial numbers. The compatibility decision was made in the 1980s and the bug has been preserved ever since.

The practical impact: Excel's day serial numbers are off by 1 for all dates from 1 March 1900 to 28 February 1900 (day 59) β€” but since almost no one works with data from 1900, this rarely causes problems. However, any code that imports Excel date serials and converts them to real dates must account for this phantom day-60.

# Correct Excel date serial to Python datetime (handling the 1900 bug)
from datetime import datetime, timedelta

def excel_date_to_python(serial):
    # Excel's epoch is 1899-12-30 (accounting for the 1900 leap year bug)
    epoch = datetime(1899, 12, 30)
    return epoch + timedelta(days=serial)

GPS epoch and week rollover

GPS time is counted in weeks since 6 January 1980, using a 10-bit week counter in the original signal format. A 10-bit counter maxes at 1023 β€” meaning every 1024 weeks (approximately 19.7 years), the counter resets to 0.

Rollover events:

  • First rollover: 21 August 1999
  • Second rollover: 6 April 2019

Older GPS receivers that didn't handle the rollover showed incorrect dates and in some cases degraded position accuracy. Most modern receivers use 13-bit week numbers internally or handle rollover through other means.


The Year 10,000 problem (Y10K)

ISO 8601 date formats use four-digit years: YYYY-MM-DD. In the year 10,000, this format breaks β€” the year requires five digits.

Unlike Y2K and Y2K38, Y10K is not an immediate concern. However:

  • Log files and data archives created today may still exist in 10,000 years (digital data is potentially more durable than stone tablets)
  • Database schemas using CHAR(10) for dates like 2024-11-15 would overflow
  • Some long-duration timestamp formats explicitly handle this

The more realistic near-term version: some systems store years in 16-bit unsigned integers, capping at 65,535 CE.


Leap seconds: the recurring problem that's now being phased out

A leap second is an extra second inserted at the end of a UTC day (23:59:60) to keep atomic clock time aligned with astronomical time (which varies due to Earth's irregular rotation).

The software problem: most systems assume 60 seconds per minute. When a leap second is inserted, some systems:

  • Stall for a second (Linux kernel pre-2016 had this bug β€” caused Google and others to see CPU spikes)
  • Jump backward, causing the same second to occur twice
  • Corrupt data timestamped "during" the leap second

Google's smear: Google and others use "leap smearing" β€” spreading the extra second over a 24-hour period, adding a tiny fraction of a second throughout the day rather than inserting a full second at midnight. This prevents the discontinuity entirely.

Resolution: the International Bureau of Weights and Measures (BIPM) voted in 2022 to abolish leap seconds by 2035. UTC and atomic time will drift; the accumulated difference will be addressed by a larger adjustment (perhaps a leap minute) no earlier than 2135.


How to use the Timestamp Converter on sadiqbd.com

  1. Convert Unix timestamps β€” paste any integer and see the corresponding UTC and local datetime
  2. Check Y2K38 margin β€” enter a future date to see its Unix timestamp and verify it fits in 32-bit (max 2,147,483,647)
  3. Epoch arithmetic β€” calculate intervals between timestamps, add/subtract durations
  4. Convert between epoch origins β€” Unix epoch (1970), Windows FILETIME epoch (1601), GPS epoch (1980)

Frequently Asked Questions

Will Y2K38 actually cause widespread disruption? Unlike Y2K, most major operating systems and programming languages have already transitioned to 64-bit timestamps. The residual risk is concentrated in embedded systems β€” industrial controllers, network appliances, some IoT devices β€” that use 32-bit Linux kernels or proprietary 32-bit time implementations and cannot be easily updated.

What timestamp format should I use in new systems? Millisecond-precision Unix timestamps (64-bit integer) for internal systems and databases; ISO 8601 (2024-11-15T14:30:00Z) for APIs and human-readable logs. Avoid 32-bit Unix timestamps in new code.

Is the Timestamp Converter free? Yes β€” completely free, no sign-up required.

Try the Timestamp Converter free at sadiqbd.com β€” convert any Unix timestamp to a readable date, or any date to its Unix timestamp.

Share:
Try the related tool:
Open Timestamp Converter

More Timestamp Converter articles