>This problem only started occuring with DW CS3, btw.
I do not use DW. So I am not sure how or even if it would affect the parsing of
dates. As I understand it, CF parses the cfqueryparam value into a date object
before the sql is sent to your database. Since most CF date functions use U.S.
date formatting rules, an ambiguous value like "12/04/2008" would be converted
to December 12th, 2008
<cfset yourDate = "12/04/2008">
<cfquery name="insertRecord" datasource="#dsn#">
INSERT INTO SomeTable (SomeColumn)
VALUES
(
<cfqueryparam value="#yourDate#" cfsqltype="cf_sql_timestamp">
)
</cfquery>
As you can see from the debug output, CF translates the value using mm/dd/yyyy
format before it is ever sent to the database.
Query Parameter Value(s) -
Parameter #1(cf_sql_timestamp) = 2008-12-04 00:00:00.0
As mentioned
- you could pre-parse the values into the correct date, or
- use a less ambiguous format, or
- if CF is running under a locale that uses dd/mm/yyyy format, you could wrap
the value in one of the LS date functions, so it is parsed correctly.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301155
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4