Ouzo\Utilities\Date::formatTime PHP Méthode

formatTime() public static méthode

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

Usage Example

Exemple #1
0
 /**
  * @test
  */
 public function shouldFormatTime()
 {
     //given
     $date = '2013-09-09 13:03:43';
     //when
     $timeOnly = Date::formatTime($date);
     //then
     $this->assertEquals('13:03', $timeOnly);
 }