3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $seg="20"; $horaActual=(new \DateTime())->format('Y-m-d H:i:s'); $horafinal = strtotime ( '-'.$seg.' second' , strtotime ( $horaActual ) ) ; $horafinal = date ( 'Y-m-d H:i:s' , $horafinal ); echo ($horaActual. PHP_EOL); echo ($horafinal. PHP_EOL); //print_r($horafinal); ?>
based on 685OZ
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.0.15, 7.0.20 - 7.1.1, 7.1.3 - 7.3.0rc3
2017-04-24 10:43:28 2017-04-24 10:43:08
Output for 7.0.16 - 7.0.18, 7.1.2
2017-04-24 10:43:27 2017-04-24 10:43:07