dateString = $this->format('Y-m-d H:i:s'); $this->tzString = $this->getTimeZone()->getName(); return array('dateString', 'tzString'); } /** * PHP "magic" function called when object is restored from serialized state. * Calls DateTime constructor with previously stored string value of date. */ function __wakeup() { parent::__construct($this->dateString, new DateTimeZone($this->tzString)); } }