3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(); $date->setTimezone(new DateTimeZone('Europe/Berlin')); $date->setDate(2012,04,21); $date->setTime(12,42,59); echo $date->format('Y-m-d H:i:s'); $date->setTimezone(new DateTimeZone('UTC')); echo $date->format('Y-m-d H:i:s');
based on cav8I
Output for 5.3.21 - 7.2.6
2012-04-21 12:42:592012-04-21 10:42:59