formatDate() public static method

Returns formatted date.
public static formatDate ( string $date, string $format = 'Y-m-d' ) : null | string
$date string
$format string
return null | string
Beispiel #1
0
 /**
  * @test
  */
 public function shouldFormatDateCustomFormatter()
 {
     //given
     $date = '2013-05-10 16:32:30.147177';
     //when
     $formattedDate = Date::formatDate($date, 'Y/m/d');
     //then
     $this->assertEquals('2013/05/10', $formattedDate);
 }
Beispiel #2
0
function formatDate($date, $format = 'Y-m-d')
{
    return Date::formatDate($date, $format);
}