Board index » delphi » FormatDateTime does not work!!

FormatDateTime does not work!!


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$>, "Erwin Krijnen"

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

Other Threads