3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime('2015-01-15 15:00:00'); var_dump($date); $date->setTimezone(new DateTimeZone('CET')); 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?!?!';
based on JhmZF