コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 public function testDateTimeWithHistoricDate()
 {
     $dateTime = new \DateTime('-0900-02-02 00:00:00');
     $instance = new DITime(2, -900, 02, 02);
     $this->assertEquals($dateTime, $instance->asDateTime());
 }