Exemple #1
0
 /**
  * @test
  */
 public function shouldFormatTimestamp()
 {
     //given
     $timestamp = '1417083911';
     //when
     $date = Date::formatTimestamp($timestamp);
     //then
     $this->assertEquals('2014-11-27 10:25', $date);
 }
Exemple #2
0
 public static function formatDateTime($format = Date::DEFAULT_TIME_FORMAT)
 {
     return function ($date) use($format) {
         return Date::formatDateTime($date, $format);
     };
 }
Exemple #3
0
function formatDateTimeWithSeconds($date)
{
    return Date::formatDateTime($date, 'Y-m-d H:i:s');
}