Times and dates with times SHOULD be stored in Coordinated Universal Time (UTC).

Incorrect:

`date_added`  DATETIME  NOT NULL


Correct:

`date_added`  TIMESTAMP  NOT NULL  DEFAULT CURRENT_TIMESTAMP


Incorrect:

`date_modified`  DATETIME  NOT NULL


Correct:

`date_modified`  TIMESTAMP  NOT NULL  ON UPDATE CURRENT_TIMESTAMP


When there are two timestamps, the logical thing to do is setting date_added to DEFAULT CURRENT_TIMESTAMP for the initial INSERT query and date_modified to ON UPDATE CURRENT_TIMESTAMP for subsequent UPDATE queries:

`date_added`     TIMESTAMP  NOT NULL  DEFAULT CURRENT_TIMESTAMP
`date_modified`  TIMESTAMP  NOT NULL  DEFAULT '0000-00-00 00:00:00'  ON UPDATE CURRENT_TIMESTAMP


This, however, only works in MySQL 5.6+. Older versions of MySQL will report an error: “Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause”.

The workaround currently implemented is to set the DEFAULT value for the initial INSERT timestamp to ‘0000-00-00 00:00:00’:

`date_added`     TIMESTAMP  NOT NULL  DEFAULT '0000-00-00 00:00:00',
`date_modified`  TIMESTAMP  NOT NULL  DEFAULT CURRENT_TIMESTAMP  ON UPDATE CURRENT_TIMESTAMP,