From the Delphi Year 2000 page (http://www.inprise.com/devsupport/y2000/delphi.html#notes3 ) :
"To make your own Delphi applications handle two digit years more reliably at the millennium, you should initialize the SysUtils global variable TwoDigitYearCenturyWindow to a positive value in the initialization section of your application."
 
"handle two digit years more reliably" - really?
 
The BDE has a fixed window with pivot on 1950.
 
TwoDigitYearCenturyWindow is a sliding window - although it's not explicitly stated as such on the web page. 
You have to look further down to find this:
"Since BDE's range is fixed at an arbitrary point and Delphi's range moves with the current year, a calculation would need to be made to match the BDE's fixed range. Something like: TwoDigitYearCenturyWindow := CurrentYear - 1950"
In other words if you want Delphi to be aligned with the BDE you have to alter your sliding window variable to keep a fixed window with the same pivot date as the BDE.
 
Under DATABASE - Locate:
"Some of the database classes use variants internally to abstract the actual data. TDataset.Locate and the Tparams class will convert string data into dates according to OLE variant conversion rules, not Delphi's string to date conversion rules."
OLE conversion will be using a window of its own - Microsoft have used 1920 and 1930 in different applications and now offer Excel plug ins to allow the user to customise the pivot year.
 
So, that's three windows that use different pivot dates. Dates that fall between the lowest and highest pivot are at risk of ambiguity.
 
To be fair, the web page also says:
"The best way to resolve Y2k issues in any application is to not allow the user to enter 2 digit years for data input or query specifications."
 

Reply via email to