/** * Permitted formatting options are specified by http://php.net/manual/en/function.date.php * * @since 2.4 * * @param string $format * * @return string|boolean */ public function format($format) { $dateTime = $this->dataItem->asDateTime(); if (!$dateTime) { return false; } $output = $this->formatWithLocalizedTextReplacement($dateTime, $format); return $output; }
public function testDateTimeWithHistoricDate() { $dateTime = new \DateTime('-0900-02-02 00:00:00'); $instance = new DITime(2, -900, 02, 02); $this->assertEquals($dateTime, $instance->asDateTime()); }