Board index » delphi » FormatDateTime does not work!!

FormatDateTime does not work!!

Hi,

In my program I set the date formats as follows:

ShortDateFormat := 'dd-mm-yyyy';
LongDateFormat := 'dd-mm-yyyy';

Somewhere else, I do following:

Field := TDateField (SomeField);
Field.DisplayFormat := 'mm/dd/yyyy';
Box.Items.Add (FormatDateTime (Field.DisplayFormat, Field.AsDateTime));

In the box the item "28-01-2002" is added instead of "01/28/2002"

This is kind of weird... Is there anyone who can help me with this? Am I
doing something wrong?

Erwin Krijnen

 

Re:FormatDateTime does not work!!


In article <ctS%7.4641$Vd.195...@zwoll1.home.nl>, "Erwin Krijnen"

Quote
<Erwin.Krij...@TecSoft.NoSpawm.nl> writes:
>Field := TDateField (SomeField);
>Field.DisplayFormat := 'mm/dd/yyyy';
>Box.Items.Add (FormatDateTime (Field.DisplayFormat, Field.AsDateTime));

Odd <g>

What type is Field ?
What does "Box.Items.Add (Field.AsString);" give you. ?

Alan Lloyd
alangll...@aol.com

Other Threads