3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = DateTimeImmutable::createFromFormat('U e', '1730597400 America/Toronto'); var_dump($time, $time->getTimestamp(), $time->format('U')); echo PHP_EOL; $date = new DateTimeImmutable('@1730597400', new DateTimeZone('America/Toronto')); var_Dump($date, $date->getTimestamp()); echo PHP_EOL; $date = DateTime::createFromFormat('U', '1730597400'); $date->setTimezone(new DateTimeZone('America/Toronto')); var_Dump($date, $date->getTimestamp());

preferences:
23.47 ms | 404 KiB | 5 Q