Quote from Delphi 4.02 Help on StrToDate:

" The TwoDigitYearCenturyWindow variable controls the interpretation of
two-digit years. If TwoDigitYearCenturyWindow is 0, year values between 0
and 99 are assumed to be in the current century. If
TwoDigitYearCenturyWindow is greater than 0, its value is subtracted from
the current year to determine the "pivot"; years on or after the pivot are
kept in the current century, while years prior to the pivot are moved to the
next century. For example:

Current year    
TwoDigitYearCenturyWindow       
Pivot   date =
mm/dd/03        date =
mm/dd/50        date =
mm/dd/68
1998    0  (default)    1900    1903    1950    1968
2002    0  (default)    2000    2003    2050    2068
1998    50      1948    2003    1950    1968
2000    50      1950    2003    1950    1968
2002    50      1952    2003    2050    1968
2020    50      1970    2003    2050    2068
2020    10      2010    2103    2050    2068
You can use TwoDigitYearCenturyWindow to extend the life of legacy
applications that are tied to two-digit-year data entry. But the best
solution is to require four-digit input for years. "

> -----Original Message-----
> From: Edward Huang [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, 9 February 1999 16:49
> To:   Multiple recipients of list delphi
> Subject:      [DUG]:  Y2K Issues - StrToDate
> 
> Hi, Group,
> 
> I'm still using Delphi 3.02 at moment, and notice that StrToDate funtion
> does not treat 2 digit year nicely.  e.g StrToDate('01/01/01') returns
> 01/01/1901, not 01/01/2001 which should be the one many people want.
> 
> Can anyone out there tell me what the result of StrToDate('01/01/01') is
> in
> Delphi 4.02?
> 
> Further question, have Delphi 4.02 standard components been Y2K compliant
> already or not?
> 
> Thanks,
> 
> --------------------------------------------------------------
> Edward Tianjun Huang                    Today Software Limited
>                                         97 Great South Road
> Email: [EMAIL PROTECTED] (Company)     Remuera
>        [EMAIL PROTECTED] (Private)    Auckland
> --------------------------------------------------------------
> 
> --------------------------------------------------------------------------
> -
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to