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. Quote Link to comment 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. Quote Link to comment 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); Quote Link to comment 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.