- timezone_open: documentation ( source)
- date_format: documentation ( source)
- date_timezone_set: documentation ( source)
<?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";
?>