/** * 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')); }
/** * {@inheritdoc} */ public static function datetime($time, $format = '%Y-%m-%d %H:%M:%S') { return parent::datetime($time, self::get('datetime', $format)); }