ZF-2290: add method to get/set the timezone by a locale (Zend/Locale/Data/supplementalData.xml)


I think it is usefull get the timezone by the locale region or by the default region of a given language e.g: de_DE => DE => Europe/Berlin de_AT => AT => Europe/Vienna en => GB => Europe/London (using the default region or throw an Exception)

the information is stored in the file Zend/Locale/Data/supplementalData.xml


There are a few things to mention:

  • The timezones are not standardized. Which means that they do not correspond with php's timezone database.
  • The avaiable localized data for timezones is not complete. Several timezones are not filled within the multiple languages.
  • Timezones differ between windows and unix or php. For example the windows timezone "africa_central" is unknown in php.
  • Localized/Normalized timezones will probably not work with Zend_Date
  • Giving the timezone for a locale could be problematic... for example the locale "en"... it would support about 20 different timezones... which to return ??
  • Also what to return if there are different supported timezones... for example within "zh_CN" or "ru_RU"

ok it need a matching table to parse timezones to the right format.

for only a given locale it can throw an exception, but on a given country code it can return a list of available timezones for this country. Than the timezone can relatively well Concerts.

The possible and available information have been implemented within the new I18N core. See SVN-7357.