Time formatting and storage bugs
From Wikipedia, the free encyclopedia
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.
Contents |
[edit] GPS date rollover
- See also: GPS#GPS time and date
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.
The first problem was related to GPS devices: 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 1,024 weeks (about 19.6 years) after January 6, 1980 (the GPS epoch), the date resets again to that date; this happened for the first time on August 21, 1999.[1] To address this concern, modernized 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.
[edit] 9/9/99
The second pre-Y2K milestone occurred in the following month. In many programs or data sets, "9/9/99" was used as a code value to indicate either an unresolved date or as a terminator to indicate no further data was in the set. This raised issues when the actual date this represents, September 9, 1999, actually arrived.[1]
[edit] Two-digit year representations
- See also: Year 1900 problem and Year 2070 problem
Followon 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 20xx, and after which are interpreted as 19xx.
For example, a program may have been changed so that it treats two-digit year values 00-68 as referring to 2000 to 2068, and values 69-99 as referring to 1969 through 1999.[2] Such a program will not be able to correctly deal with years beyond 2068.
For applications wanting to calculate the birth year (or other passed 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.
[edit] Year 2011 in Taiwan
Taiwan (known formally as the Republic of China) officially uses the Minguo calendar, which considers the Gregorian year 1912 to be its year 1. Thus, the Gregorian year 2011 will be the ROC year 100, its first 3-digit year.[3]
[edit] Year 2038
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, January 1, 1970. This value will roll over on January 19, 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.
[edit] 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.
[edit] 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.
In the case of the year 32,768 problem, years after 32,767 may be interpreted as negative numbers, beginning with -32,768.[4] The year 65,536 problem is more likely to manifest itself by representing the year 65,536 as the year 0.[5]
[edit] "Problems" that aren't problems
Certain problematic years occur well past the predicted heat death of the universe, so are mainly referenced as jokes, or to indicate that a related problem truly is solved for any reasonable or unreasonable definition of "solved."
- The year 170,141,183,460,469,231,731,687,303,715,884,105,727 problem: this is the year that 128-bit Unix time would reset to zero.[7]
[edit] See also
[edit] References
- ^ a b Janis L. Gogan. "Applications To The Nines", InformationWeek, August 9, 1999. Retrieved on 2008-01-21.
- ^ date - write the date and time, The Open Group Base Specifications Issue 6. IEEE Std 1003.1, 2004 Edition
- ^ Pinyin news » Taiwan’s Y1C problem
- ^ Top 10 Fun Reasons why you Should Stop Using Delphi, now!
- ^ http://libsnap.dom.edu/ClasPlus/ADDONS/Y2K.TXT
- ^ Project 2038 FAQ
- ^ Jan Beulich - enable maximum integer type to be 128 bits

