format() public méthode

Return date in the given format.
public format ( string $format ) : string
$format string A valid date format.
Résultat string A string containing the date in the given $format.
 public function testSub()
 {
     $dt = new DateTimeObject('14.02.2013');
     $dt->sub("5 days");
     $this->assertSame('09.02.2013', $dt->format('d.m.Y'));
 }