示例#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));
 }