begonz
asked on
DateTimePicker - DateToStr - FormatSettings
Can anyone tell me, how I can format a date that is in a DateTimePicker.
What the problem is, I have a DateTimePicker on a form and the input format is, yyyy/MM/dd. That is fine. When I try and use this value it puts it in a different format, dd/MM/yyyy.
I am doing the following:
DateEntered := DateToStr(DateTimePicker1. Date);
How can I force the date to be in the format yyyy/MM/dd into a variable to use, like it is on the screen??? I tried playing around with FormatSettings but just got lost.
Thanks.
Bego.
What the problem is, I have a DateTimePicker on a form and the input format is, yyyy/MM/dd. That is fine. When I try and use this value it puts it in a different format, dd/MM/yyyy.
I am doing the following:
DateEntered := DateToStr(DateTimePicker1.
How can I force the date to be in the format yyyy/MM/dd into a variable to use, like it is on the screen??? I tried playing around with FormatSettings but just got lost.
Thanks.
Bego.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@padmaja: why repeat what I have already said?
ASKER
Thanks for that PierreC! Easy points. I almost had it just around the wrong way. :o)
glad to help
AS PierreC says, you can format it using FormatDateTime function
DateEntered := FormatDateTime('yyyy/MM/dd
with regards,
padmaja.