diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 036259a83..a87422459 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -265,13 +265,13 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity // MSSQLDatabase::date() uses datetime for the data type for "Date" and "SSDatetime" switch($this->db($k)) { case "Date": - $v = preg_replace('/([ap]m)$/i', ' \\1', $v); + $v = preg_replace('/:[0-9][0-9][0-9]([ap]m)$/i', ' \\1', $v); $record[$k] = date('Y-m-d', strtotime($v)); break; case "Datetime": case "SSDatetime": - $v = preg_replace('/([ap]m)$/i', ' \\1', $v); + $v = preg_replace('/:[0-9][0-9][0-9]([ap]m)$/i', ' \\1', $v); $record[$k] = date('Y-m-d H:i:s', strtotime($v)); break; }