niceTime() public static method

Takes time as hh:mm:ss or YYYY-MM-DD hh:mm:ss
public static niceTime ( string $time ) : string
$time string
return string Time in format hh:mm
Exemplo n.º 1
0
 /**
  * TimeTest::testNiceTime()
  *
  * @return void
  */
 public function testNiceTime()
 {
     $result = $this->Time->niceTime('22:11:18');
     $expected = '22:11';
     $this->assertEquals($expected, $result);
     $result = $this->Time->niceTime('2014-11-12 22:11:18');
     $this->assertEquals($expected, $result);
 }