public function toString() { $date = $this->format('Y-m-d'); $offset = $this->getOffset(); if ($offset != 0) { $date .= DateTime::getOffsetBySeconds($offset); } return $date; }
public function toString() { $time = $this->format('H:i:s'); $ms = $this->getMicroSecond(); $offset = $this->getOffset(); if ($ms > 0) { $time .= '.' . $ms; } if ($offset != 0) { $time .= DateTime::getOffsetBySeconds($offset); } return $time; }