Clicky

hi all,

i have an application which has a TDateTimePicker component.

the default data format i use is DD.MM.YYYY, the problem i met is: when i change the data format in computer system or the applciation runs another computer which has a different data format, it doesn't work and an error message like "data format error" will be displayed.

any suggestion to fix such problem?

thanks,
wantime

asked 07/18/2011 03:37

wantime's gravatar image

wantime ♦♦


8 Answers:
you can expand your code here?
link
minhvc's gravatar image

minhvc

The most general string format is YYYY-MM-DD, used by most programming languages and SQL databases.  
link
DaveBaldwin's gravatar image

DaveBaldwin

You will be having this problem if you try to restrict the Date/Time to a particular format which differs from PC to PC and from User to User.
The best way to handle Date and Time is to let the system identify the format as per the user default/customized configurations.

So let the TDateTimePicker gets the default format of the system, and when saving to DB store the TDateTimePicker.Date in Date/Time fields.
link
jimyX's gravatar image

jimyX

i mentioned that i have made a mistake,  i forgot to change the zone for my question. anyone would do me a favor?
link
wantime's gravatar image

wantime

i realized that i have made a mistake,  i forgot to change the zone for my question. anyone would do me a favor?
link
wantime's gravatar image

wantime

You need to click on "Request attention", located underneath to your question, and provide the changes/updates you need.
link
jimyX's gravatar image

jimyX

PHP Zone removed

mlmcc
Zone Advisor
link
mlmcc's gravatar image

mlmcc


Dont set your own format, let delphi handle the format for you, you only need to worry about how to manipulate the dates
link
ewangoya's gravatar image

ewangoya

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1
×44

Asked: 07/18/2011 03:37

Seen: 454 times

Last updated: 07/28/2011 09:28