3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = new DateTime("@1351382400"); var_dump($date1->format('c')); // Sun Oct 28 2012 00:00:00+00:00 var_dump($date1->getTimestamp()); //prints: 1351382400 $date1->setTimezone(new DateTimeZone("Europe/Stockholm")); var_dump($date1->format('U')); // prints: 1351382400 var_dump($date1->getTimestamp()); //prints: 1351386000
based on pts6t