Date windowing


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

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.

Windowing methods

There are three primary methods used to determine the date window:
's FOCUS "Century Aware" implementation 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
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

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, and any year before or equal to the pivot year will belong to last century.
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.
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 "fixed-60" code establishes a fixed date window of 1960 through 2060. It assumes that none of the dates are before 1960, and should work until the year 2060.