Is there an easy way to retrieve the locale from the timezone_identifier
?
For example:
date_default_timezone_set('Europe/Berlin');
The Locale in that case should de_DE
.
Is there an easy way to retrieve the locale from the timezone_identifier
?
For example:
date_default_timezone_set('Europe/Berlin');
The Locale in that case should de_DE
.
As deceze
said there is no possiblity of this. But you can get location information from timezone. as php.net says
$tz = new DateTimeZone("Europe/Prague");
print_r($tz->getLocation());
print_r(timezone_location_get($tz));
will output
Array
(
[country_code] => CZ
[latitude] => 50.08333
[longitude] => 14.43333
[comments] =>
)
Array
(
[country_code] => CZ
[latitude] => 50.08333
[longitude] => 14.43333
[comments] =>
)
No, because there's no such 1:1 correlation. Take Belgium for example, where they officially speak three languages in the same timezone.