Depends on what you are trying to achieve.
If you simply what to always have your Delphi application use the 4
digit year, regardless of what the users set windows to try this.

In the application's project file
 
Application.Initialize;
Application.UpdateFormatSettings := False; 
ShortDateFormat := 'd/mm/yyyy';  { ensure that century is shown }




                -----Original Message-----
                From:   Tom Munro Glass [mailto:[EMAIL PROTECTED]]
                Sent:   Wednesday, April 14, 1999 12:17 AM
                To:     Multiple recipients of list delphi
                Subject:        RE: [DUG]:  DateToStr & Y2K

                How about this?

                procedure TMainForm.FormCreate(Sender: TObject);
                begin
                  Application.OnIdle := OnIdle;
                end;

                procedure TMainForm.OnIdle(Sender: TObject; var Done:
Boolean);
                begin
                  if Pos('yyyy', ShortDateFormat) = 0 then
                    ShortDateFormat := StringReplace(ShortDateFormat,
'yy', 'yyyy',
                [rfReplaceAll]);
                end;

                Also, if you have any forms with the TDateTimePicker
component, add the
                following to the FormCreate procedure:

                  SendMessage(DateTimePicker1.Handle, DTM_SETFORMAT, 0,
                LPARAM(PChar(ShortDateFormat)));

                You will need to add CommCtrl to the 'uses' list.

        
==================================================================

                Tom Munro Glass

        
+----------------------------------------------------------------+
                | E-mail:
|
                |     Internet:           [EMAIL PROTECTED]
|
                |     CompuServe:         100101,1243 or
[EMAIL PROTECTED]   |
                | Web sites:
|
                |     TMG CONSULTANCY:    http://www.tmgcon.com
|
                |     Tewkesbury Web:     http://www.tmgcon.com/tewksweb
|
        
+----------------------------------------------------------------+

        
------------------------------------------------------------------------
---
                    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