Merge pull request #1348 from thomseddon/consistent-timestamps

Unify modified/created times. Both the created/updated timestamps will reflect the same point in time now.
This commit is contained in:
Mark Story 2013-06-12 07:13:48 -07:00
commit d52c401ff2

View file

@ -1662,13 +1662,14 @@ class Model extends Object implements CakeEventListener {
}
$db = $this->getDataSource();
$now = time();
foreach ($dateFields as $updateCol) {
if ($this->hasField($updateCol) && !in_array($updateCol, $fields)) {
$default = array('formatter' => 'date');
$colType = array_merge($default, $db->columns[$this->getColumnType($updateCol)]);
if (!array_key_exists('format', $colType)) {
$time = strtotime('now');
$time = $now;
} else {
$time = call_user_func($colType['formatter'], $colType['format']);
}