Hi guy's, this is a problem that has been driving me mad for a while. I have 
recently converted my website to be multi-lingual so that it now displays in 
French, German, Spanish, Italian and English. It is written using Coldfusion MX 
6.1 and has a SQL2000 database backend.

My problems have started with the formatting and submitting of date fields. The 
main problem that I am having is with LSDateFormat. All of my date fields are 
stored in my database in the format YYYYMMDD. I have no problem reading the 
data and displaying it using LSDateFormat i.e. if my users locale is "German 
(Standard)"

I read the date from SQL as "2004-12-31"
#LSDateFormat(MyDate, "DD MMM YYYY")# displays it as "31 Dez 2004", so far this 
is fine.

When I click my save button to submit this data back to the database I have to 
first convert this date back to a format that SQL will understand, this is 
where the problem occurrs as the following code;

#lsdateformat(mydate, "YYYYMMDD")# produces this error "31 Dez 2004" is an 
invalid date format. As you can see I am trying to format the date as 
"20041231" so I can insert it back into my database.

I do not understand why I am getting the error message that the date is invalid 
anybody know?

Also is it possible to convert dates between locale's such as converting the 
user input German date of "31 Dez 2004" to the English date of "31 Dec 2004"?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:184108
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to