Automated Timestamps
DataMapper has the ability to automattically manage your Created and Updated timestamps, if your tables have the Created and Updated fields. By default, DataMapper looks for fields names created and updated. If they exist, it looks after the values for these fields without you ever needing to set them.
Note: By default, the Created and Updated fields are of the DateTime type, and GMT/UTC time is used.
If you would like to change the name of the Created and Updated fields, you can do so by setting the $created_field and $updated_field class variables in your DataMapper model. For example, we'll set them in our User model: