There has been so much discussion o the date problems that people don't
realize one thing!
The date is determined by your server setup, if anyone is to use a
server there are 2 places that need to be addressed and region settings
is one that is always overlooked.
So when in Australia or any country where the date should be dd/mm/yyyy,
the server's settings will take the regional settings zone and if this
is in the format mm/dd/yyyy then that is how CF will translate it.
I have posted this about 50 times in the last 3 years:-)
The problem is that some CF functions don't use this and others do, I
have no idea when or if MM will fix this, but yes it is annoying if you
are not aware of this problem!
-----Original Message-----
From: Andy Ewings [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 12:25 AM
To: CF-Talk
Subject: RE: Interesting Date issue
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