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 ???) Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1444811 Share on other sites More sharing options...
Solution Barand Posted August 13, 2013 Author Solution Share Posted August 13, 2013 Thanks guys. Quote 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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/281136-half-a-timezone/#findComment-1445113 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.