3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = new DateTime('2015-01-15 15:00:00', new DateTimeZone('CET')); var_dump($date); echo "\n Date timestamp using format(): " . $date->format('U'); echo "\n Date timestamp using getTimestamp(): " . $date->getTimestamp(); echo "\nChanging timezone to CET"; $date->setTimezone(new DateTimeZone('CET')); echo "\n Date timestamp using format(): " . $date->format('U') . ' NB: This has changed?!?!'; echo "\n Date timestamp using getTimestamp(): " . $date->getTimestamp() . ' NB: Now it is back?!?!'; echo "\n Date timestamp using format() again: " . $date->format('U') . ' NB: Now it is back?!?!';

preferences:
44.74 ms | 402 KiB | 5 Q