<?php
$timezones = array("America/New_York", "Australia/Victoria", "Europe/Moscow", "Europe/Kiev", "Brazil/East");
function get_time($tz){
$date = new DateTime('now', new DateTimeZone($tz));
return $date->format('d-m-Y H:i:s');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Time Zone Info</title>
<style>
body{background:#CCC;}
</style>
<meta http-equiv="refresh" content="10;url=times.php">
</head>
<body>
<?php
foreach($timezones as $zone){
$dt = get_time($zone);
echo "<p><strong>".$zone."</strong> - ".$dt."</p>".PHP_EOL;
}
?>
</body>
</html>
Comments