Jump to content

Half a timezone


Barand

Recommended Posts

 

I always thought timezones had differences of whole hours. Can anyone explain the output below?

<?php
$d = new DateTime();

$d->setTimezone(new DateTimeZone('Europe/London'));
echo "<pre>London\t\t" . $d->format ('H:i:s') . '<br>';

$d->setTimezone(new DateTimeZone('Asia/Hong_Kong'));
echo "Hong Kong\t" . $d->format ('H:i:s') . '<br>';

$d->setTimezone(new DateTimeZone('Asia/Calcutta'));
echo "Calcutta\t" . $d->format ('H:i:s') . '</pre>';

?>

output

 

London      19:45:35
Hong Kong   02:45:35
Calcutta    00:15:35    (15 minutes ???)
Link to comment
https://forums.phpfreaks.com/topic/281136-half-a-timezone/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.