Exemple #1
0
 /**
  * このオブジェクトの時刻部分の文字列を "hh:mm:ss" 形式で返します.
  * @return string "hh:mm:ss" 形式の文字列
  */
 public function formatTime()
 {
     $format = parent::formatTime();
     $sec = str_pad($this->second, 2, '0', STR_PAD_LEFT);
     return $format . ":" . $sec;
 }
Exemple #2
0
 /**
  * 配列・Map 以外の型を指定した場合に InvalidArgumentException をスローすることを確認します.
  * @expectedException InvalidArgumentException
  * @covers Peach\DT\Datetime::setAll
  */
 public function testSetAllFail()
 {
     $d = new Datetime(2012, 5, 21, 7, 30);
     $d->setAll("hoge");
 }
Exemple #3
0
 /**
  * 指定された Datetime オブジェクトを書式化します.
  * @param  Datetime $d 書式化対象の時間オブジェクト
  * @return string      このフォーマットによる文字列表現
  */
 public function formatDatetime(Datetime $d)
 {
     return $this->formatTimestamp($d->toTimestamp());
 }