3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $original_timezone = new DateTimeZone('UTC'); $datetime = new DateTime('06-01-2016 19:00 UTC', $original_timezone); $target_timezone = new DateTimeZone('EDT'); $datetime->setTimeZone($target_timezone); $triggerOn = $datetime->format('Y-m-d h:i:s T'); echo $triggerOn; echo timezone_offset_get($triggerOn);
based on dXvbB
Output for 7.0.0 - 7.2.0
2016-01-06 02:00:00 EDT Fatal error: Uncaught TypeError: Argument 1 passed to timezone_offset_get() must be an instance of DateTimeZone, string given in /in/DOluB:9 Stack trace: #0 /in/DOluB(9): timezone_offset_get('2016-01-06 02:0...') #1 {main} thrown in /in/DOluB on line 9
Process exited with code 255.
Output for 5.5.24 - 5.6.28
2016-01-06 02:00:00 EDT Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in /in/DOluB on line 9
Output for 5.3.21 - 5.4.45
2016-01-06 02:00:00 EST Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in /in/DOluB on line 9