Comment on page
Automatic Time Stamps
Let CFWheels handle time stamping of records.
When working with database tables, it is very common to have a column that holds the time that the record was added or last modified. If you have an e-commerce website with an orders table, you want to store the date and time the order was made; if you run a blog, you want to know when someone left a comment; and so on.
As with anything that is a common task performed by many developers, it makes a good candidate for abstracting to the framework level. So that's what we did.
If you have either of the following columns in your database table, CFWheels will see them and treat them a little differently than others.
createdat
updatedat
If you add any of these columns to your table, make sure they can accept date/time values (like
datetime
or timestamp
, for example) and that they can be set to null
.Time stamping is done in UTC (Coordinated Universal Time) by default but if you want to use your local time instead all you have to do is change the global setting for it like this:
set(timeStampMode="local");