3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('UTC'); $date1 = new DateTime('2015-01-01T12:00:00'); $date2 = new DateTime('2015-01-01T12:01:00'); var_dump($date1 < $date2); $date1->setTimezone(new DateTimeZone('UTC')); $date2->setTimezone(new DateTimeZone('EST')); var_dump($date1 < $date2); $date1->getTimestamp(); $date2->getTimestamp(); var_dump($date1 < $date2);

preferences:
58.56 ms | 406 KiB | 5 Q