Board index » delphi » Change format dd/mm/yyyy to mm/dd/yyyy

Change format dd/mm/yyyy to mm/dd/yyyy

If the data is in a TDateTime type field or variable see the DecodeDate
procedure in the on-line help. If the date is a string you will have to use
the Pos and Copy functions to take it apart and reassemble it.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

 

Re:Change format dd/mm/yyyy to mm/dd/yyyy


??? i want to change datetime in dd/mm/yyyy to mm/dd/yyyy for use
in SQL command .? please sample me simple method.? i can convert
it by use cut string but i think it can use format or other way which
easier.

thank for advice
sriket

Re:Change format dd/mm/yyyy to mm/dd/yyyy


Quote
>??? i want to change datetime in dd/mm/yyyy to mm/dd/yyyy for use
>in SQL command .? please sample me simple method.? i can convert
>it by use cut string but i think it can use format or other way which
>easier.

FormateDateTime('mm/dd/yyyy',DateVariable)

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Change format dd/mm/yyyy to mm/dd/yyyy


Hi,

Quote
> >??? i want to change datetime in dd/mm/yyyy to mm/dd/yyyy for use
> >in SQL command . please sample me simple method. i can convert
> >it by use cut string but i think it can use format or other way which
> >easier.

> FormateDateTime('mm/dd/yyyy',DateVariable)

You have to be careful of the DateSeparator,it is not always '/', maybe
'-'....

FormateDateTime('mm"/"dd"/"yyyy',DateVariable)

-----
Rika

Other Threads