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

>No, you cannot do this unless you know which country your application is
>going to be run in. For example in some countries mm/dd/yyyy is the correct
>format. In other countries they may use different separator characters from
>the /. It is for this reason you should use the information that Windows
>gets for you from the Control Panel.

I thought there was a DateSeparator global as welll.  Either way this should
work better.

if pos('yyyy',ShortDateFormat)=0 then 
Insert('yy',ShortDateFormat,pos('yy',ShortDateFormat));

DO you have to check for 'yyy' since a helpful box in the regional settings said it's 
valid...
Haven't tried to see what an 'abbreviated' year looks like...

the above should probably be.

if (pos('yyyy',ShortDateFormat)=0) and
  (pos('yyy',ShortDateFormat)=0) and
  (pos('yy',ShortDateFormat)>0) then 
Insert('yy',ShortDateFormat,pos('yy',ShortDateFormat));

--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax

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

Reply via email to