File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,27 @@ to the current default locale::
335335 $currencies = Intl::getCurrencyBundle()->getCurrencyNames('de');
336336 // => array('AFN' => 'Afghanische Afghani', ...)
337337
338+ Timezones
339+ ~~~~~~~~~
340+
341+ The translations of timezone names can be found in the timezone bundle::
342+
343+ use Symfony\Component\Intl\Intl;
344+
345+ \Locale::setDefault('en');
346+
347+ $timezones = Intl::getTimezoneBundle()->getTimezoneNames();
348+ // => array('Africa/Abidjan' => 'Abidjan', ...)
349+
350+ $timezone = Intl::getTimezoneBundle()->getTimezoneName('America/St_Barthelemy');
351+ // => 'St. Barthélemy'
352+
353+ All methods accept the translation locale as the last, optional parameter,
354+ which defaults to the current default locale::
355+
356+ $timezones = Intl::getTimezoneBundle()->getTimezoneNames('de');
357+ // => array('Africa/Abidjan' => 'Abidjan', ...)
358+
338359That's all you need to know for now. Have fun coding!
339360
340361.. _Packagist : https://packagist.org/packages/symfony/intl
You can’t perform that action at this time.
0 commit comments