Patrick,

> Perhaps someone could bring me up to date on the issue of the DateToStr
> function which returns a string form of the date according to the
> ShortDateFormat global variable (or I think it is LOCALE_SSHORTDATE in the
> Win32 API).

When a Delphi app starts up, the VCL reads the Windows short date format and
stores it in a global variable (ShortDateFormat).  This variable also gets
updated everytime someone makes a change to the short date format.  What you
will need to do to ensure Y2K compatibility is to make sure this variable is
set to 4 digit year EVERYTIME you use DateToStr (write a wrapper function).

> Microsoft's Year 2000 compatibility statement for Windows 95 etc
> makes this
> statement for COMCTL32.DLL:
>
> COMCTL32.DLL  When Regional Settings from Control Panel is set to use two
> digits for years, the Date/Time Picker function may not return the proper
> date. To ensure proper handling of dates: set Regional Settings to 4-digit
> date handling.

The updated COMCTL32.DLL that comes with IE4 has a further style for the
DateTimePicker, called ShortDateY2K or something like that.  In essence, it
uses the short date format, but with 4 digit years.  If you are going to use
TDateTimePicker, make sure that your clients either use IE4 or have a
COMCTL32.DLL that is version 4.71 or greater.  Furthermore, you will need to
send the control a message to tell it to switch to the Y2K style as this
style is not directly supported by Delphi's TDateTimePicker (not in version
3 anyway - haven't looked in version 4).

For us we tell our clients to set their short date format to 4 digit years
or we will not guarantee Y2K compliance.  Setting the short date format this
way also ensures that older MS apps are Y2K compliant (eg. Access).  This is
especially important if you interface to them in any way or other.


-----------------------------------------------------
Dennis Chuah, BE (Hons) [mailto:[EMAIL PROTECTED]]
Manager, Product Development
Contec Data Systems Ltd. [http://www.contecds.com]
tel: +64-3-3580060 ext-775 fax: +64-3-3588045



---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to