Is there a way in Zend Framework or default PHP to map a country (using country code) to a list of timezones? As an example I'm trying to replicate the Google functionality when searching for "time in australia right now" which displays all of the timezones and cities for that country.
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
Not sure about Zend_Date, but native PHP can do that as of PHP5.3 with
DateTimeZone::listIdentifiers
— Returns numerically index array with all timezone identifiersExample:
outputs:
Note that the country must be supplied as a two-letter ISO 3166-1 compatible country code. Apparently, this means 'us' is not the same as 'US' (at least I don't get a result then).