1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 22:26:43 +02:00

added DateTime53, fix for crappy DateTime in PHP 5.2

This commit is contained in:
David Grudl
2010-01-14 23:41:37 +01:00
parent 9d4a887e7a
commit e177436e38
4 changed files with 65 additions and 7 deletions

View File

@@ -623,13 +623,13 @@ class DibiResult extends DibiObject implements IDataSource
return is_numeric($value) ? (int) $value : strtotime($value);
} elseif ($format === TRUE) { // return DateTime object
return new DateTime(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);
return new DateTime53(is_numeric($value) ? date('Y-m-d H:i:s', $value) : $value);
} elseif (is_numeric($value)) { // single timestamp
return date($format, $value);
} else {
$value = new DateTime($value);
$value = new DateTime53($value);
return $value->format($format);
}