3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2017-03-26 1:59:59', new DateTimeZone('Europe/Prague')); echo $date->format('Y-m-d H:i:s T') . PHP_EOL; $date->modify('+ 1 second')->modify('- 1 second'); echo $date->format('Y-m-d H:i:s T') . PHP_EOL; echo "\n"; $date = new DateTime('2016-10-30 2:00:00', new DateTimeZone('Europe/Prague')); echo $date->format('Y-m-d H:i:s T') . PHP_EOL; // $date->modify('+ 2 second'); echo $date->format('Y-m-d H:i:s T') . PHP_EOL;
based on ii7u5
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
2017-03-26 01:59:59 CET 2017-03-26 03:59:59 CEST 2016-10-30 02:00:00 CET 2016-10-30 02:00:00 CET