예제 #1
0
 /**
  * Test that datetime() formats a timestamp to a date and time.
  */
 public function testDatetime()
 {
     $time = mktime(16, 35, 0, 2, 26, 1988);
     $this->assertEquals('1988-02-26 16:35:00', Format::datetime($time));
     $this->assertEquals('02/26/1988 04:35PM', Format::datetime($time, '%m/%d/%Y %I:%M%p'));
 }
예제 #2
0
파일: Format.php 프로젝트: titon/g11n
 /**
  * {@inheritdoc}
  */
 public static function datetime($time, $format = '%Y-%m-%d %H:%M:%S')
 {
     return parent::datetime($time, self::get('datetime', $format));
 }