mirror of
https://github.com/dg/dibi.git
synced 2025-02-24 10:53:17 +01:00
DibiResult: fixed normalization of time when begins by 00:
This commit is contained in:
parent
e87c112d71
commit
cf942c68ce
@ -524,7 +524,7 @@ class DibiResult extends DibiObject implements IDataSource
|
|||||||
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';
|
$row[$key] = ((bool) $value) && $value !== 'f' && $value !== 'F';
|
||||||
|
|
||||||
} elseif ($type === dibi::DATE || $type === dibi::DATETIME) {
|
} 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)
|
} 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);
|
$row[$key] = new DibiDateTime(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user