Barand Posted August 13, 2013 Share Posted August 13, 2013 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 More sharing options...
PaulRyan Posted August 13, 2013 Share Posted August 13, 2013 http://www.timeanddate.com/time/time-zones-interesting.html Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1444810 Share on other sites More sharing options...
mac_gyver Posted August 13, 2013 Share Posted August 13, 2013 there's a handful of 30 minute ones and a couple of 15/45 minute ones - http://en.wikipedia.org/wiki/List_of_time_zones_by_UTC_offset Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1444811 Share on other sites More sharing options...
Barand Posted August 13, 2013 Author Share Posted August 13, 2013 Thanks guys. Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1444814 Share on other sites More sharing options...
WebDesignerDeveloper Posted August 15, 2013 Share Posted August 15, 2013 Dear Barand Thanks for your co-operation, actually, I am new to PHP you wrote: $d->setTimezone(new DateTimeZone('Europe/London')); what is the mean of........... ->............... as you wrote .... $d -> Regards Satbir Singh Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1445110 Share on other sites More sharing options...
Barand Posted August 15, 2013 Author Share Posted August 15, 2013 $d is and object. -> is the notation to call an object's methods or variables. See http://php.net/manual/en/language.oop5.php Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1445113 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.