3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 1730597400 = 01:30:00 according to UTC $date = DateTime::createFromFormat('U', '1730597400'); var_dump($date); // 01:30:00 of UTC // 1730597400 = 21:30:00 according to America/Toronto $date = DateTime::createFromFormat('U e', '1730597400 America/Toronto'); var_dump($date); // 21:30:00 of America/Toronto // 1730597400 = 01:30:00 according to UTC $date = DateTime::createFromFormat('U', '1730597400'); $date->setTimezone(new DateTimeZone('America/Toronto')); var_dump($date); // 21:30:00 of America/Toronto

preferences:
22.73 ms | 404 KiB | 5 Q