>(suppose DateVar has the value "2003-02-23 18:34:59 ") it probably does.....but your not calling the variable.... your trying to change the text value "DateVar" into a date > #LsDateFormat("DateVar", 'dd/mm/yyyy')#
try them without quotes #LsDateFormat(DateVar, 'dd/mm/yyyy')# #LsDateFormat(CREATEODBCDateTime(Now()), 'dd/mm/yyyy')# good luck ----- Original Message ----- From: "Leonardo Crespo - Cftop.COM" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 24, 2003 1:04 PM Subject: URGENT, cfmx interprets MYSQL date (yyyy-mm-dd hh:mm:ss) as INVALID! > I'm evaluating cfmx on j2ee. I use mysql as database and all my date are stored in mysql default format, witch is "yyyy-mm-dd hh:mm:ss". I'm using the Portugues(Brazilian) locale. > > As you know, MYSQL stores DateTime objects in the format "YYYY-MM-DD HH:MM:SS". > > When i try to run the code: > > <cfquery name=bla....> > Select DateField from .... > </cfquery> > > <cfset DateVar = bla.DateField> (suppose DateVar has the value "2003-02-23 18:34:59 ") > #LsDateFormat("DateVar", 'dd/mm/yyyy')# > > it throws an error saying 2003-02-23 18:34:59 is an INVALID date format. > > the same error is returned if i use the CREATEODBCDateTime function, as follow > #LsDateFormat("CREATEODBCDateTime(Now())", 'dd/mm/yyyy')# throwns this error: > > "{ts '2003-01-07 16:23:09'} " is an invalid date format. > > > ALSO, > > <cfset temp = ParseDateTime("{ts '2003-23-02 18:34:59'}")> > <cfoutput>#LsDateFormat(temp, 'dd/mm/yyyy')#</cfoutput> > > outputs this: > {ts '2003-02-24 12:52:28'} 02/11/2004 > > when the correct date is > 24/02/2003 (dd/mm/yyyy format). > > > I cant understand why the mysql default date format is not valid anymore. I realy dont want to change all my date fields in my database, or change all my code that use dates (witch are quite alot). Does anyone knows why CFMX does that and does anyone knows a solution? > > Tks alot > > Leonardo > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4