D. J. Bernstein
Time

Y2K and other time bombs

1999-08-22: 10-bit GPS week numbers

Many GPS receivers are limited to a 1024-week cycle of dates.

2000-01-01: Two-digit years

UNIX software is mostly immune to the Y2K problem. UNIX keeps track of time as the number of seconds since the beginning of 1970, not as a year-month-day-hour-minute-second date-time counter. Many UNIX programs print dates and times for human consumption, but very few UNIX programs read or compare dates.

The committee that designed the format of Internet mail message headers foolishly used a date-time counter. They originally provided only 2 digits for the year. In 1989 they allowed (and recommended) 4 digits. All versions of qmail produce 4-digit years.

I have reviewed my software packages and found two that read dates. My libtai library works with dates in the Gregorian calendar; it supports a range of billions of years. My mess822 library, which relies on libtai, can read dates in mail messages; it automatically converts 2-digit (and 3-digit) years into 4-digit years. A future version of qmail will use mess822 to clean up outgoing mail from ancient clients that fail to use 4-digit years.

2036-02-07: Unsigned 32-bit seconds since 1900

Many operating systems keep track of time as the number of seconds since the beginning of 1900. This number will overflow an unsigned 32-bit counter in 2036.

The main threat for UNIX here is NTP, the Network Time Protocol, which counts seconds since 1900. Many NTP clients will become rather confused when the counter overflows.

My TAICLOCK protocol, which like NTP announces the current time through the network, relies on the TAI64 time format, which supports a range of hundreds of billions of years.

2038-01-19: Signed 32-bit seconds since 1970

The big UNIX time bomb is 2038, when the number of seconds since the beginning of 1970 will overflow a signed 32-bit counter.

I offer TAI64 to the UNIX community as a replacement format for 32-bit UNIX time. Once UNIX kernels have been upgraded to support TAI64, it will be easy to upgrade applications too. The most difficult step will be conversion of 32-bit databases, such as existing filesystems, but it should be easy to complete the conversion by the year 2020.

10000-01-01: Four-digit years

Don't contribute to the Y10K problem! Thanks to my lobbying, Internet mail messages are now allowed to have 5-digit years.