From cf942c68ce8301c3dfdc7123c91e0dca270935c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20H=C5=AFla?= Date: Mon, 15 Jul 2013 15:22:04 +0200 Subject: [PATCH] DibiResult: fixed normalization of time when begins by 00: --- dibi/libs/DibiResult.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dibi/libs/DibiResult.php b/dibi/libs/DibiResult.php index 1bb56fa..f16d6b7 100644 --- a/dibi/libs/DibiResult.php +++ b/dibi/libs/DibiResult.php @@ -524,7 +524,7 @@ class DibiResult extends DibiObject implements IDataSource $row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F'; } elseif ($type === dibi::DATE || $type === dibi::DATETIME) { - if ((int) $value === 0) { // '', NULL, FALSE, '0000-00-00', ... + if ((int) $value === 0 && substr((string) $value, 0, 3) !== '00:') { // '', NULL, FALSE, '0000-00-00', ... } elseif (empty($this->formats[$type])) { // return DateTime object (default) $row[$key] = new DibiDateTime(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);