Yizi Posted August 27, 2014 Share Posted August 27, 2014 Hi, this is my first post and I just need some guidance, I'm trying to write a function (ultimatly create a page) where it would show where in the world is 12 clock e.g. so I'm base din UK and I visit the page (run the function) and it would scan all time options possible and spits out where (if) in the world it's 12 lock. Thanks. Link to comment https://forums.phpfreaks.com/topic/290678-calculate-time-world/ Share on other sites More sharing options...
cpd Posted August 27, 2014 Share Posted August 27, 2014 Have an array containing each time zone. Loop through it creating DateTime objects and testing if they have a 12 hour hand. Once you've found the timezone break out and display the zone. Using http://us3.php.net/manual/en/datetimezone.getlocation.php you an get a friendlier name as well. Link to comment https://forums.phpfreaks.com/topic/290678-calculate-time-world/#findComment-1489051 Share on other sites More sharing options...
Barand Posted August 27, 2014 Share Posted August 27, 2014 To get you started, this will get the array of timezones $tz_array = DateTimeZone::listIdentifiers(DateTimeZone::ALL); Link to comment https://forums.phpfreaks.com/topic/290678-calculate-time-world/#findComment-1489053 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.