3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $my_timezone = new DateTimeZone("Europe/London"); $server_timezone = new DateTimeZone("America/New_York"); $my_date = new DateTime("now", $my_timezone); $server_date = new DateTime("now", $server_timezone); $my_offset = $my_timezone->getOffset($my_date); $server_offset = $server_timezone->getOffset($server_date); echo "[my: $my_offset][srv: $server_offset]";
Output for 5.5.24 - 5.5.30, 5.5.34 - 5.6.16, 5.6.20 - 5.6.28, 7.0.5 - 7.1.0
[my: 3600][srv: -14400]
Output for 5.2.0 - 5.4.45, 5.5.33, 5.6.19, 7.0.4
[my: 0][srv: -18000]
Output for 5.5.31 - 5.5.32, 5.6.17 - 5.6.18, 7.0.0 - 7.0.3
[my: 0][srv: -14400]
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTimeZone' not found in /in/ekXsu on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/ekXsu on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetimezone in /in/ekXsu on line 2