Time formatting and storage bugs

In computer science, time formatting and storage bugs are a class of software bugs which may cause time and date calculation or display to be improperly handled. These are most commonly manifestations of arithmetic overflow, but can also be the result of other issues. The most well-known consequence of bugs of this type is the Y2K problem, but many other milestone dates or times exist that have caused or will cause problems depending on various programming deficiencies.
Year 1975.
On 4 January 1975, the 12-bit field that had been used for dates in the Decsystem 10 operating systems overflowed. There were numerous problems and crashes related to this bug while an alternative format was developed.
Year 1978.
The PDP-8's OS/8 operating system used 
This was recognized when COS-310 was developed, and dates were recorded differently.
Year 1989.
Some mainframe programs were written to encode dates as the number of days since a 'zero date' of 1 January 1900, storing them as signed 16-bit binary integers. On 18 September 1989, these programs began to fail, the date being exactly 32,768 (215) days since the zero date. Values on and after this day do not fit into a signed 16-bit integer, but overflow and return negative values.
Year 1997.
The Domain/OS clock, which is based on the number of 4-microsecond units that has occurred since 1 January 1980, rolled past 47 bits on 2 November 1997, rendering unpatched systems unusable.
Year 1999.
In the last few months before the year 2000, two other date-related milestones occurred that received less publicity than the then-impending Y2K problem.
First GPS rollover.
GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.
9/9/99.
In many programs or data sets, "9/9/99" was used as a rogue value to indicate either an unresolved date or as a terminator to indicate no further data was in the set. This raised issues upon the arrival of the actual date this represents, 9 September 1999.
Year 2000.
Two-digit year representations.
Follow-on problems caused by certain temporary fixes to the Y2K problem will crop up at various points in the 21st century. Some programs were made Y2K-compliant by continuing to use two digit years, but picking an arbitrary year prior to which those years are interpreted as 20"xx", and after which are interpreted as 19"xx".
For example, a program may have been changed so that it treats two-digit year values 00–68 as referring to 2000 through 2068, and values 69–99 as referring to 1969 through 1999. Such a program will not be able to correctly deal with years beyond 2068.
For applications required to calculate the birth year (or another past year), such an algorithm has long been used to overcome the Year 1900 problem, but it has failed to recognise people over 100 years old.
Year 2010.
Some systems had problems once the year rolled over to 2010. This was dubbed by some in the media as the "Y2K+10" or "Y2.01k" problem.
The main source of problems was confusion between hexadecimal number encoding and BCD encodings of numbers. The numbers 0 through 9 are encoded in both hexadecimal and BCD as 00 through 09. But the decimal number 10 is encoded in hexadecimal as 0A and in BCD as 10. Thus a BCD 10 interpreted as a hexadecimal encoding erroneously represents the decimal number 16.
For example, the SMS protocol uses BCD encoding for dates, so some mobile phone software incorrectly reported dates of messages as 2016 instead of 2010. Windows Mobile was the first software reported to have been affected by this glitch; in some cases WM6 changed the date of any incoming SMS message sent after 1 January 2010 from the year 2010 to 2016.
Other systems affected include EFTPOS terminals, and the PlayStation 3 (except the Slim model).
The most important such glitch occurred in Germany, where upwards of 20 million bank cards became unusable, and with Citibank Belgium, whose digipass customer identification chips stopped working.
Year 2011.
Taiwan officially uses the Minguo calendar, which considers the Gregorian year 1912 to be its year 1. Thus, the Gregorian year 2011 is the ROC year 100, its first 3-digit year.
Year 2013.
The unmanned Deep Impact spaceprobe lost communication with Earth on 11 August 2013, after a clock counted 232 deciseconds (tenths of seconds) since 1 January 2000.
Year 2015.
Several older Samsung mobile phones with Agere chipsets (such as Samsung SGH-C170) would refuse to change dates beyond 31 December 2014; the date would automatically change to 2015, but would revert to the base date in the event of a power cycle (loss of battery power).
Year 2019.
Second GPS rollover.
GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.
Japanese calendar transition.
On 30 April 2019, Emperor Akihito of Japan abdicated favoring his son Naruhito. As years in Japan are traditionally referred to by era names that correspond to the reign of each emperor, this resulted in a new era name, Reiwa (令和), following Naruhito's accession to the throne the following day. Because the previous emperor, Hirohito, died 7 January 1989 and Akihito's reign mostly corresponded with the rise in the use of computers, most software had not been tested to ensure correct behavior on an era change. Furthermore, testing was complicated by the fact that the new era name was not revealed until 1 April 2019. Therefore, errors were expected from software that did not anticipate a new era.
Year 2020.
"WWE 2K20" and "" would both crash on 1 January 2020, when the year rolled over. The glitches could only be circumvented by resetting the year back to 2019 until a patch was released. Additionally, Crystal Reports 8.5 would fail to generate specific reports starting in 2020.
Parkeon parking meters in New York City and other locations were unable to accept credit cards as a form of payment starting in 2020. A workaround was implemented, but required each meter to be individually updated. In New York, the meters were not expected to be fixed until 9 January.
In Poland, 5,000 cash registers stopped printing the date out properly.
SUUNTO sport smart watches showed out an error in computing week days, that was presented with a +2 step (aka: FRI rather WED, SAT rather than THU). For SUUNTO Spartan model watches, bug was fixed with firmware release 2.8.32.
Classic Mac OS.
The control panel in Classic Mac OS versions 6, 7, and 8 only allows the date to be set as high as 31 December 2019, although the system is able to continue to advance time beyond that date.
Year 2021.
Samsung users reported that phones running on the latest One UI 3.0 update or Android 11 lost access to the battery and charging statistics starting in 2021. Affected devices would not report usage statistics, thus leaving those sections blank. Older Sony Bravia models now report invalid data when trying to set EPG reminders.
Year 2028.
During the late 1970s, on Data General Nova and Eclipse systems, World Computer Corporation (doing credit union applications) created this date format;
16-bit date field:
Dates were directly comparable using unsigned functions.
No known instances of this format are in use today.
Year 2031.
Some systems, like MediaTek's Nucleus OS, only go up to 31 December 2030.
Year 2032.
Palm OS uses both signed integers with the 1970 epoch, as well as unsigned integers with the 1904 epoch, for different system functions, such as for system clock, and file dates (see PDB format). While this should result in Palm OS being susceptible to the 2038 problem, Palm OS also uses a 7-bit field for storing the year value, with a different epoch counting from 1904, resulting in a maximum year of (1904+127) 2031.
Year 2036.
The Network Time Protocol has an overflow issue related to the Year 2038 problem, which manifests itself at 06:28:16 UTC on 7 February 2036, rather than 2038. The 64-bit timestamps used by NTP consist of a 32-bit part for seconds and a 32-bit part for fractional second, giving NTP a time scale that rolls over every 232 seconds (136 years) and a theoretical resolution of 2−32 second (233 picoseconds). NTP uses an epoch of 1 January 1900. The first rollover occurs in 2036, prior to the UNIX year 2038 problem.
Year 2038.
Unix time rollover.
The original implementation of the Unix operating system stored system time as a 32-bit signed integer representing the number of seconds past the Unix epoch: midnight UTC, 1 January 1970. This value will roll over on 19 January 2038. This problem has been addressed in most modern Unix and Unix-like operating systems by storing system time as a 64-bit signed integer, although individual applications, protocols, and file formats will still need to be changed as well.
DVB rollover.
The Digital Video Broadcast system has an issue on 22 April 2038, when the 16 bits used to transmit Modified Julian Days used for electronic guide scheduling will restart from zero. The ETSI EN 300 368 specification mentions in Annex C that the provided MJD formulas are valid until 28 February 2100, but makes no mention of the limits imposed by the 16 bits used to transmit the resulting value.
Third GPS rollover.
GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.
Year 2040.
Early Apple Macintosh computers store time in their real-time clocks (RTCs) and HFS filesystems as an unsigned 32-bit number of seconds since 00:00:00 on 1 January 1904. After 06:28:15 on 6 February 2040, this will wrap around to 1904. HFS+, the default format for all of Apple's recent Macintosh computers, is also affected. The replacement Apple File System resolves this issue.
ProDOS for the Apple II computers only supports two-digit year numbers. To avoid Y2K issues, Apple issued a technical note stating that the year number was to represent 1940-2039. Software for the platform may incorrectly display dates beginning in 2040. A third-party effort is underway to update ProDOS and application software to support years up to 2924.
Year 2042.
On 18 September 2042, the Time of Day Clock (TODC) on the S/370 IBM mainframe and its successors, including the current zSeries, will roll over.
Older TODCs were implemented as a 64-bit count of 2 microsecond (0.244 ns) units, and the standard base was 1 January 1900 UT. In July 1999 the extended TODC clock was announced, which extended the clock to the right (that is, the extended bits are less significant than the original bits). The actual resolution depends on the model, but the format is consistent, and will, therefore, roll over after 252 microseconds.
The TODC value is accessible to user mode programs and is often used for timing and for generating unique IDs for events.
While IBM has defined and implemented a longer (128-bit) hardware format on recent machines, which extends the timer on both ends by at least 8 additional bits, many programs continue to rely on the 64-bit format which remains as an accessible subset of the longer timer.
Year 2048.
The ATSC system will have an issue similar to the DVB issue described above after 2048 due to its use of signed 32-bit GPS seconds that begin from 6 January 1980.
The capacity planning logic in the ERP system SAP S/4HANA supports only finish dates up to 19 January 2048 (24855 days from 1 January 1980). This concerns e.g. the production, maintenance and inspection planning.
Year 2050.
Various Texas Instruments calculators of the TI BA II Plus, TI BA II Plus Professional, TI-83, TI-84 and NSpire families support a function named dbd to calculate the number of days between dates. This function accepts dates between 1950-01-01 and 2049-12-31 only. One potential area where this will start causing problems in 2020 is in the calculation of 30-year mortgages.
Year 2051.
The Wii and Nintendo 3DS will roll over at the end of 31 December 2050, rolling back to 1 January 2000. Some games on those consoles that have their own calendar systems, will roll back to a different year determined by the game; such as "", which will roll back to 1 January 2012.
Year 2079.
Days 32,768 and 65,536.
Programs that store dates as the number of days since an arbitrary date (or "epoch") are vulnerable to roll-over or wrap-around effects if the values are not wide enough to allow the date values to span a large enough time range expected for the application. Signed 16-bit binary values roll over after 32,768 (215) days from the epoch date, producing negative values. Some mainframe systems experienced software failures because they had encoded dates as the number of days since 1 January 1900, which produced unexpected negative day numbers on the roll-over date of 18 September 1989. Similarly, unsigned 16-bit binary days counts overflow after 65,536 (216) days, which are truncated to zero values. For software using an epoch of 1 January 1900, this will occur on 6 June 2079.
Year 2080.
Some (if not all) Nokia phones that run Series 40 (such as the Nokia X2-00) only support dates up to 2079-12-31 and will refuse to change dates further than 2079-12-31. The workaround is to use the year 1996 in lieu of 2080 as a compatible leap year to display the correct day of the week, date and month on the main screen.
Systems storing the year as a two-digit value 00..99 internally only (like many RTCs) may roll over from 2079-12-31 to the IBM PC and DOS epoch of 1980-01-01.
Year 2100.
DOS and Windows file date API and conversion functions (such as INT 21h/AH=2Ah) officially support dates up to 2099-12-31 only (even though the underlying FAT filesystem would theoretically support dates up to 2107). Hence, DOS-based operating systems, as well as applications that convert other formats to the FAT/DOS format, may show unexpected behavior starting 2100-01-01.
The Nintendo DS will roll over at the end of 31 December 2099, rolling back to 1 January 2000 while the Nintendo GameCube only allows the date to be manually set as high as that same date, although the system can still advance time beyond that date.
Another problem will emerge at the end of 2100-02-28, since 2100 is not a leap year, whereas many common implementations of the leap year algorithm are incomplete or simplified, and thus will erroneously assume it to be a leap year. This would cause the date to incorrectly roll over from 2100-02-28 to 2100-02-29, instead of directly to 2100-03-01.
Year 2106.
Many existing file formats, communications protocols, and application interfaces employ a variant of the Unix date format, storing the number of seconds since the Unix Epoch (midnight UTC, 1 January 1970) as an "unsigned" 32-bit binary integer. This value will roll over on 7 February 2106 at 06:28:15. That is, at this time the number of seconds since 1 January 1970 is FFFF FFFF in hex.
Year 2108.
The date timestamps stored in FAT filesystems, originally introduced with 86-DOS 0.42 in 25 February 1981 and carried over into MS-DOS, PC DOS, DR-DOS etc., will overflow at the end of 2107-12-31. The last modification date stamp (and with DELWATCH 2.0+ also the file deletion date stamp, and since DOS 7.0+ optionally also the last access date stamp and creation date stamp), are stored in the directory entry with the year represented as an unsigned seven bit number (0–127), relative to 1980, and thereby unable to indicate any dates in the year 2108 and beyond. The API functions defined to retrieve these dates officially only support dates up to 2099-12-31.
This will also affect the ZIP archive file format, as it uses FAT file modification timestamps internally.
Year 2137.
GPS dates are expressed as a week number and a day-of-week number, with the week number initially using a ten-bit value and modernised GPS navigation messages using a 13-bit field. Ten-bit systems would roll over every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), and 13-bit systems roll over every 8192 weeks. Thirteen-bit systems will roll over to zero in 2137.
Year 2262.
Some timekeeping systems count nanoseconds since 1970 using a 64-bit signed integer, which will overflow at 11 April 2262 23:47:16. The Go programming language's API is one example. Other examples include the Timestamp object in Python pandas, C++ chrono::system_clock, and the QEMU timers.
Years 4000 and 8000.
While most software, including Excel and R, recognize 4000 and 8000 as leap years (as they are divisible by 400), SAS does not (an unofficial "4000 year rule"). Thus date conversions between SAS and other software go out of sync after February 28, 4000, without accounting for that discrepancy.
Year 4501.
Microsoft Outlook uses the date 1 January 4501 as a placeholder for "none" or "empty".
Year 10,000.
The year 10,000 will be the first Gregorian year with five digits. Although many people at first consider this year to be so far distant that a problem of this type will never actually occur, certain classes of calculations in disciplines such as astronomy and physics already need to work with years of this magnitude and greater. These applications also have to deal with the Year zero problem. All future powers of 10 years have the potential for similar problems.
"RFC 2550 - Y10K and Beyond" discusses solutions for dealing with this problem.
Year 30,828.
Beginning 14 September 30,828, Windows will not accept dates beyond this day and on startup, Windows will complain about "invalid system time". This is because the FILETIME value in Windows, which is a 64-bit value corresponding to the number of 100-nanosecond intervals since 1 January 1601, 00:00:00.0000000 UTC, will overflow its maximum possible value on that day at 02:48:05.4775808 UTC. This is because of integer overflow.
Years 32,768 and 65,536.
Programs that process years as 16-bit values may encounter problems dealing with either the year 32,768 or 65,536, depending on whether the value is treated as a signed or unsigned integer.
For the year 32,768 problem, years after 32,767 may be interpreted as negative numbers, beginning with −32,768. The year 65,536 problem is more likely to manifest itself by representing the year 65,536 as the year 0.
Year 292,277,026,596 problem.
Certain problematic years occur so far in the future, well beyond the likely lifespan of the Earth, the Sun, humanity, and even past some predictions of the lifetime of the universe), that they are mainly referenced as matters of theoretical interest, jokes, or indications that a related problem is not truly solved for any reasonable definition of “solved”. The year 292,277,026,596 problem (about years in the future) will occur when the 64-bit Unix time overflows at UTC 15:30:08 on Sunday, 4 December, 292,277,026,596 AD.
Relative time overflow.
Microsoft.
In Microsoft Windows 7, Windows Server 2003, Windows Server 2008 and Windows Vista, TCP connection start information was stored in 1/100ths of a second, using a 32-bit unsigned integer, causing an overflow and TCP connections to fail after 497 days.
Boeing.
The Boeing 787 aircraft has had at least two software issues related to time storage. In 2015 an error was reported where time was stored in 1/100ths of a second, using a signed 32-bit integer, and the systems would crash after 248 days. In 2020, the FAA issued an airworthiness directive for a problem where, if the aircraft is not powered down completely before reaching 51 days of uptime, systems will begin to display misleading data.