Sam Farmer

Growing up I never imagined I would play bass guitar for the Dave Matthews Band. And indeed it never happened.

But I have become passionate about making software.

ORM and Dates? You probably want timestamp

November 22, 2010

Data types for dates and times are slightly different across databases which often makes life difficult for us developers. ColdFusion ORM makes this pretty simple:

There are no other options!

Full example with the property tag:

property name="aFullDateWithTime" ormtype="timestamp"; property name="justADate" ormtype="date";

2 Comments

How would I create a MS SQL TimeStamp though?????

By: Darrin 03/28/2012 9:45 AM
Several options: You can set the database to use timestamp on the column. You can use the optimistic locking: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WS2F0C1CDB-4CAF-42fd-B7D9-500D82C0136A.html And set property name="lastModified" fieldtype="timestamp"; You could also look into the DDL options: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSB7BEC0B4-8096-498d-8F9B-77C88878AC6C.html

By: Sam Farmer 03/28/2012 10:07 AM
Some comments have been lost over the years due to moving hosts.

More


More blog entries that I have written.

Code coloring by PRISM.