3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php date_default_timezone_set('Australia/Sydney'); $value = '2010-09-08T07:05:04+0300'; $date = \DateTime::createFromFormat('Y-m-d\TH:i:sO', $value); echo $date->getTimezone()->getName() . PHP_EOL; print $date->format('c e') . PHP_EOL; $date->setTimezone(new \DateTimeZone('America/Managua')); echo $date->getTimezone()->getName() . PHP_EOL; print $date->format('c e') . PHP_EOL; $date->setTimezone(new \DateTimeZone('Australia/Sydney')); echo $date->getTimezone()->getName() . PHP_EOL; print $date->format('c e') . PHP_EOL;
based on mUf36
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0alpha1
+03:00 2010-09-08T07:05:04+03:00 +03:00 America/Managua 2010-09-07T22:05:04-06:00 America/Managua Australia/Sydney 2010-09-08T14:05:04+10:00 Australia/Sydney
Output for hhvm-3.15.4
Australia/Sydney 2010-09-08T07:05:04+03:00 +03:00 America/Managua 2010-09-07T22:05:04-06:00 America/Managua Australia/Sydney 2010-09-08T14:05:04+10:00 Australia/Sydney