3v4l.org

run code in 300+ PHP versions simultaneously
<?php //First we are setting the time to the current time, in the Chicago time zone $date = new DateTime(null, new DateTimeZone('America/Chicago')); //Then We are going to echo this information echo "<b>Chicago:</b> "; echo date_format($date, 'F jS Y H:i:s P') . "<br>"; //Now we are going to show the exact same time, the current time, for Madrid echo "<b>Madrid:</b> "; date_timezone_set($date, timezone_open('Europe/Madrid')); echo date_format($date, 'F jS Y H:i:s P') . "\n"; ?>

preferences:
38.89 ms | 402 KiB | 5 Q