8000 [Intl] Document timezone support by c960657 · Pull Request #6209 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Intl] Document timezone support #6209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
< 8000 div class="d-flex flex-justify-center">
Diff view
[Intl] Document timezone support
  • Loading branch information
Christian Schmidt authored and c960657 committed Mar 23, 2016
commit 4a717da6db2b83e691066cd061ad000ac8f79f40
21 changes: 21 additions & 0 deletions components/intl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,27 @@ to the current default locale::
$currencies = Intl::getCurrencyBundle()->getCurrencyNames('de');
// => array('AFN' => 'Afghanische Afghani', ...)

Timezones
~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version added ?

The translations of timezone names can be found in the timezone bundle::

use Symfony\Component\Intl\Intl;

\Locale::setDefault('en');

$timezones = Intl::getTimezoneBundle()->getTimezoneNames();
// => array('Africa/Abidjan' => 'Abidjan', ...)

$timezone = Intl::getTimezoneBundle()->getTimezoneName('America/St_Barthelemy');
// => 'St. Barthélemy'

All methods accept the translation locale as the last, optional parameter,
which defaults to the current default locale::

$timezones = Intl::getTimezoneBundle()->getTimezoneNames('de');
// => array('Africa/Abidjan' => 'Abidjan', ...)

That's all you need to know for now. Have fun coding!

.. _Packagist: https://packagist.org/packages/symfony/intl
Expand Down
0