Ouzo\Utilities\Date::formatTime PHP 메소드

formatTime() 공개 정적인 메소드

Returns formatted time.
public static formatTime ( string $time, string $format = 'H:i' ) : null | string
$time string
$format string
리턴 null | string
    public static function formatTime($time, $format = 'H:i')
    {
        return self::formatDate($time, $format);
    }

Usage Example

예제 #1
0
파일: DateTest.php 프로젝트: letsdrink/ouzo
 /**
  * @test
  */
 public function shouldFormatTime()
 {
     //given
     $date = '2013-09-09 13:03:43';
     //when
     $timeOnly = Date::formatTime($date);
     //then
     $this->assertEquals('13:03', $timeOnly);
 }