Kevin
I have had an absolute nightmare with CF and dates. I wrote a complex
application which completely depended on date manipulation and the only
robust way I found to do it was as follows. I createed dates in CF by using
CreateDate to perform date validation. When I came to add it to the db I
broke the date down by using the Year, Month, Day functions and passing the
date in a string to SQL as dd/mm/yyyy. I then entered the date into the SQL
db ensuring that I had correctly set the dateformat in the db by using SET
DATEFORMAT DMY.
This was the most robust way I could find. I was annoyed at the fact that
CF appeared to decide whether a date was dd/mm/yyyy or mm/dd/yyyy depending
on the value of the day part (i.e. if it was over 12 or not)
-----Original Message-----
From: Kevin Schmidt [mailto:[EMAIL PROTECTED]]
Sent: 06 June 2001 16:06
To: CF-Talk
Subject: Interesting Date issue
Ok...either I am doing something stupid or something is wrong here.
This is on CF 5.0
I am using <CFSET Today = Dateformat(Now(), "mm/dd/yy"> and then inserting
today into a database table. I end up with 12/31/1899.
Here is the really tricky part. After that date is set I use DateAdd to add
a month to it and insert it into the database at the same time as the other
and I get the correct date. Any ideas.
By the way I changed the today code to <CFSET Today = CreateODBCDate(Now())>
and it is fine. But I am still curious as to why the other way was
producing that result???
Kevin Schmidt, Web Technology Manager
Allaire Certified ColdFusion Developer
pwb inc.
integrated marketing communications
350 S. Main St., Suite 350
Ann Arbor, MI 48104
734.995.5000 (tel)
734.995.5002 (fax)
www.pwb.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists