- var_dump: documentation ( source)
<?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?!?!';