3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $dateTime = \DateTime::createFromFormat('U', 1499716740); var_dump($dateTime); $timeZone = new \DateTimeZone('Europe/Madrid'); $dateTime = $dateTime->setTimezone($timeZone); var_dump($dateTime);
Output for 5.6.30, hhvm-3.15.4 - 3.22.0, 7.0.0 - 7.3.1
object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-10 19:59:00.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+00:00" } object(DateTime)#1 (3) { ["date"]=> string(26) "2017-07-10 21:59:00.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Madrid" }