3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $Now = new DateTime(); echo $Now->format('Y-m-d') . '\n'; // 2014-06-12 $Duration = new DateInterval('PT1M'); // 1minute $Now->add( $Duration ); echo $Now->format('Y-m-d'); // 2014-07-12 $Duration = new DateInterval('P1D'); // 1Day $Now->sub( $Duration ); echo $Now->format('Y-m-d'); // 2014-05-12
based on 5TDb3
Output for 5.3.20 - 7.3.0
2015-12-02\n2015-12-022015-12-01