3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dates = ['2017-05-21 01:00:00.000Z', '2017-05-21 10:00:00.000Z', '2017-05-21 23:00:00.000Z', '2017-05-22 03:00:00.000Z']; $amsterdam = new DateTimezone('Europe/Amsterdam'); $newYork = new DateTimezone('America/New_York'); foreach ($dates as $date) { echo ((new DateTime($date))->setTimezone($amsterdam)->format('d/m/Y H:i:s')), PHP_EOL; echo ((new DateTime($date))->setTimezone($newYork)->format('d/m/Y H:i:s')), PHP_EOL, PHP_EOL; }
based on MAVdY
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
21/05/2017 03:00:00 20/05/2017 21:00:00 21/05/2017 12:00:00 21/05/2017 06:00:00 22/05/2017 01:00:00 21/05/2017 19:00:00 22/05/2017 05:00:00 21/05/2017 23:00:00