Dates are not stored in a database in American of European format. They are 
stored in the database's unambiguous format. If you pass in a US or Euro date 
then your DBMS is converting it before storing. You should take charge of this 
conversion. Try using something like this...

<cfqueryparam value="#lsParseDateTime(form.theDate)#" 
cfsqltype="CF_SQL_TIMESTAMP">

I am assuming you've set your locale with setLocale(). When you display a date 
from a database you must always use lsDateFormat().


-----Original Message-----
From: Mark Flewellen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 25 January 2006 10:46 a.m.
To: CF-Talk
Subject: Date Formats

I am having trouble with Date Formats on a Windows Server, running CFMX7 and 
mysql,

I am wanting to have dates appear in a European Format ie. dd/mm/yyyy and once 
posted from a form for them to be saved in the MySQL Database in an American 
Format (which it does by default).

However I am finding that if I post a date such as 10/12/2005 (ie. 10 December 
2005), this will save in the database as 2005-10-12 (ie. 12 October 2005),

but

if I save a date such as 18/12/2005 (ie. 18 December 2005), this saves in the 
database in the correct format ie. 2005-12-18

It seems whenever the day value is below 13 it seems to swap the day and the 
month around.

Anyone got any ideas?

Mark



                
___________________________________________________________
NEW Yahoo! Cars - sell your car and browse thousands of new and used cars 
online! http://uk.cars.yahoo.com/




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:230377
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