3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set("Europe/Berlin"); $tz = new \DateTimeZone("Europe/Berlin"); $ts = 1490281920; $obj1 = new DateTime("@$ts", $tz); var_dump($obj1->format('c')); $obj = new DateTime("@$ts"); $obj->setTimezone($tz); var_dump($obj->format('c')); $date = date("c", $ts); var_dump($date);
based on DNb3Z
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0rc3
string(25) "2017-03-23T15:12:00+00:00" string(25) "2017-03-23T16:12:00+01:00" string(25) "2017-03-23T16:12:00+01:00"