Physics:Date windowing

From HandWiki
Short description: Running software in real time for display and reporting six-digit date into eight-digit date

Date windowing is a method by which dates with two-digit years are converted to and from dates with four-digit years.[1] The year at which the century changes is called the pivot year of the date window.[2] Date windowing was one of several techniques used to resolve the year 2000 problem in legacy computer systems.[3]

Reasoning

For organizations and institutions with data that is only decades old, a "date windowing" solution was considered easier and more economical than the massive conversions and testing required when converting two-digit years into four-digit years.[3][4]

Windowing methods

There are three primary methods used to determine the date window:

  • Fixed pivot year: simplest to code, works for most business dates.
  • Sliding pivot year: determined by subtracting some constant from the current year, typically used for birth dates.
  • Closest date: Three different interpretations (last century, this century, and next century) are compared to the current date, and the closest date is chosen from the three.

FOCUS

Information Builders's FOCUS "Century Aware" implementation[5] allowed the user to focus on field-specific and file-specific settings.

This flexibility gave the best of all three major mechanisms: A school could have file RecentDonors set a field named BirthDate to use

DEFCENT=19 YRTHRESH=31, covering those born 1931-2030.

Those born 2031 are not likely to be donating before 2049, by which time those born 1931 would be 118 years old, and unlikely current donors. DEFCENT and YRTHRESH for a file containing present students and recent graduates would use different values.

Examples

Below is a simple example of fixed date windowing COBOL code, often used to figure the century for ordinary business dates.

IF RECEIPT-DATE-YEAR >= 60
   MOVE 19 TO RECEIPT-DATE-CENTURY
ELSE
   MOVE 20 TO RECEIPT-DATE-CENTURY
END-IF.

The above code establishes a fixed date window of 1960 through 2059. It assumes that none of the receipt dates are before 1960, and should work until January 1, 2060.[3]

Unix and Windows systems have environment variables that set the fixed pivot year for the system. Any year after the pivot year will belong to this century (the 21st century), and any year before or equal to the pivot year will belong to last century (the 20th century).[6]

Some products, such as Microsoft Excel 95 used a window of years 1920–2019 which had the potential to encounter a windowing bug reoccurring only 20 years after the year 2000 problem had been addressed.[7]

The IBM i operating system uses a window of 1940-2039 for date formats with a two-digit year.[8] In the 7.5 release of the operating system, an option was added to use a window of 1970-2069 instead.[9]

See also

References

  1. Bridis, Ted (1999-03-16). "Temporary Y2K fix may last only a generation" (html). https://www.onlineathens.com/stories/031699/new_y2k.shtml. "Using windowing, programmers instruct software to guess the century for dates that fall within a specific "window" of time, such as the next three decades. The computer interprets the year based on a future so-called hinge date, or pivot, that programmers choose arbitrarily" 
  2. Healton, Gilbert (2014-07-12). "The Best of Dates, The Worst Of Dates" (html). http://x109.healton.net/y2k/yrexamples.html#_GoodGuys.Pivot. "A pivot year, also known as date windowing, takes a two-digit year and expands it to determine which century the year is in. Typically the year is converted to either a full four-digit year or into the year-1900 format, as appropriate to the application at hand." 
  3. 3.0 3.1 3.2 Raymond B. Howard. "The Case for Windowing: Techniques That Buy 60 Years". Year/2000 Journal (Mar/Apr 1998). "Windowing is a long-term fix that should keep legacy systems working fine until the software is redesigned...". 
  4. McNish, Larry (2019-12-30). "The Y2K Pivot Year Problem". https://grumpyoldastronomer.com/y2kpivot.htm. "The choice of the actual pivot year was made by companies based on their historical records. It was in no way an industry standard, nor was this approach in any way professionally recommended. But it would work for a while." 
  5. Kruskopfs, Peter. "Solving the Date Dilemma". Information Builders. p. 4. http://www.ibi.com/special/year2k/dilemma.html. "expanded version of the sliding windows technique .. File and field level settings" 
  6. "Chapter 1: Pivot Year" (html). 2003. https://www.appx.com/common/documents/manuals/appx/sysadmin/Chapter_1_Orientation_to_the_Manual/Chapter_1__Orientation_to_t.htm. "By defining a pivot year, you direct APPX to determine what century a particular year belongs to. For example, if the pivot year is set to 35, then any date field with a year greater than 35 will be assumed by APPX to have a century value of 19. Any date field with a year less than or equal to the pivot year will be assumed by APPX to have a century value of 20." 
  7. Livingston, Brian (1999-02-09). "COMPUTING Spot & fix Y2K problems in Windows 9x & NT" (html). http://edition.cnn.com/TECH/computing/9902/09/testy2k.idg/index.html. "The other common behavior that Windows users will experience involves dates in spreadsheet programs such as Microsoft Excel, Lotus 1-2-3, and Corel Quattro Pro. If you have typed all your dates with four-digit years (such as 1/1/1999 and 1/1/2000), you should be fine. But if you have typed two-digit years (such as 1/1/29), you may be surprised at the way different programs handle the date." 
  8. "New base year support for 2-digit year date formats". IBM. 2022-05-03. https://www.ibm.com/support/pages/new-base-year-support-2-digit-year-date-formats. 
  9. Alex Woodie (2022-05-03). "Announcement Day: IBM Lifts The Veil On IBM i 7.5 And 7.4 TR6". https://www.itjungle.com/2022/05/03/announcement-day-ibm-lifts-the-veil-on-ibm-i-7-5-and-7-4-tr6/.