The Time is #Now()#

So here is something I ran into recently. Take a look at the following queries:

<cfquery name="insertNow1" datasource="scratch">
INSERT INTO TestTable
(
TestText
,TestDateTime
)
VALUES
(
'Test without queryparam'
,#Now()#
)
</cfquery>

<cfquery name="insertNow2" datasource="scratch">
INSERT INTO TestTable
(
TestText
,TestDateTime
)
VALUES
(
<cfqueryparam value="Test with queryparam" cfsqltype="cf_sql_varchar">
,<cfqueryparam value="#Now()#" cfsqltype="cf_sql_timestamp">
)
</cfquery>

You may expect the above two queries to give you the same results, but they don't. If you don't use cfqueryparam the datetime value is only stored to the second precision.

ID TestText TestDateTime ------ ---------------------------------- ---------------------------- 1 Test without queryparam 2008-02-12 15:31:51.000 2 Test with queryparam 2008-02-12 15:31:51.717

This is because the string representation of a coldfusion.runtime.OleDateTime object is only precise to the second. (Try dumping Now() and you will see you get a time stamp similar to {ts '2008-02-12 15:31:51'}. Notice no milliseconds.) This is just something to keep in mind, especially if your application depends on timestamps.

ColdFire SVN

As you may have heard Ray Camden and Rob Gonda recently made some updates to RIAForge which allow project owners to share SVN access. After this update Ray was kind enough to give me access to the ColdFire repository and since then I've done some reorganizing. So, what will you find in the ColdFire SVN repo?

[More]

ColdFire Security Update

A little over a week ago I became aware a 0-day security exploit in ColdFire. I finally have a working fix which Ray has just released over at RIAForge. I strongly recommend that all ColdFire users download and install the latest version (1.003) as soon as possible.

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.