Here is the real code:
it reads a TXT file that has {ts '2003-01-07 16:23:09'} as content:
<cffile action="read" file="#AbsolutePath#\AnimaisOnline\Chat\UltimaAtualizacao.txt"
variable="dtUltimaAtualizacao">
#LsDateFormat(dtUltimaAtualizacao, 'dd/mm/yyyy')#
Then i got the error:
"{ts '2003-01-07 16:23:09'} " is an invalid date format.
That's very wierd, that error was not ocurring in cf5 =/
----- Original Message -----
From: Mike Townend
To: CF-Talk
Sent: Monday, February 24, 2003 3:15 PM
Subject: RE: URGENT, cfmx interprets MYSQL date (yyyy-mm-dd hh:mm:ss) as INVALID!
Drop the quotes...
#LsDateFormat(DateVar, 'dd/mm/yyyy')#
Instead of
#LsDateFormat("DateVar", 'dd/mm/yyyy')#
HTH
Mikey
=========================================
http://www.phonebin.com
"From Phone to Web in minutes"
-----Original Message-----
From: Leonardo Crespo - Cftop.COM [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 18:05
To: CF-Talk
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
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4