diff --git a/dibi/libs/DibiDateTime.php b/dibi/libs/DibiDateTime.php index c5ed4987..0a4362e4 100644 --- a/dibi/libs/DibiDateTime.php +++ b/dibi/libs/DibiDateTime.php @@ -34,6 +34,22 @@ class DibiDateTime extends DateTime + public function modifyClone($modify = '') + { + $dolly = clone($this); + return $modify ? $dolly->modify($modify) : $dolly; + } + + + + public function modify($modify) + { + parent::modify($modify); + return $this; + } + + + public function __sleep() { $this->fix = array($this->format('Y-m-d H:i:s'), $this->getTimezone()->getName()); @@ -62,4 +78,11 @@ class DibiDateTime extends DateTime return $this->__construct(date('Y-m-d H:i:s', $timestamp), new DateTimeZone($this->getTimezone()->getName())); // getTimeZone() crashes in PHP 5.2.6 } + + + public function __toString() + { + return $this->format('Y-m-d H:i:s'); + } + }