3v4l.org

run code in 200+ PHP versions simultaneously
<?php $dt1 = new \DateTime('2016-10-30 00:30:00', new \DateTimeZone('UTC')); $dt2 = new \DateTime('2016-10-30 01:30:00', new \DateTimeZone('UTC')); var_dump($dt1->getTimestamp()); var_dump($dt2->getTimestamp()); var_dump($dt1->setTimezone(new \DateTimeZone('Europe/Brussels'))->format(\DateTime::RFC3339)); var_dump($dt2->setTimezone(new \DateTimeZone('Europe/Brussels'))->format(\DateTime::RFC3339)); var_dump($dt1->getTimestamp()); var_dump($dt2->getTimestamp()); var_dump($dt1->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339)); var_dump($dt2->setTimezone(new \DateTimeZone('UTC'))->format(\DateTime::RFC3339)); var_dump($dt1->getTimestamp()); var_dump($dt2->getTimestamp());
Output for 5.5.0 - 7.4.1
int(1477787400) int(1477791000) string(25) "2016-10-30T02:30:00+02:00" string(25) "2016-10-30T02:30:00+01:00" int(1477791000) int(1477791000) string(25) "2016-10-30T01:30:00+00:00" string(25) "2016-10-30T01:30:00+00:00" int(1477791000) int(1477791000)