yongtiger/timezone

v0.0.3 2017-03-16 18:35 UTC

This package is not auto-updated.

Last update: 2024-12-21 21:58:00 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

FEATURES

USAGE

  • Usecase #1: using sort flags
$tzs = TimeZone::timezone_list(TimeZone::SORT_BY_OFFSET);
  • This will generate an array looking like:
[Pacific/Midway] => (UTC-11:00) Pacific/Midway
[Pacific/Pago_Pago] => (UTC-11:00) Pacific/Pago_Pago
[Pacific/Niue] => (UTC-11:00) Pacific/Niue
[Pacific/Honolulu] => (UTC-10:00) Pacific/Honolulu
[Pacific/Fakaofo] => (UTC-10:00) Pacific/Fakaofo
...
  • Usecase #2: customized your own static::$timezones
TimeZone::$timezones = DateTimeZone::listIdentifiers();
$tzs = TimeZone::timezone_list();
  • Usecase #3: using output format template
$tzs = TimeZone::timezone_list(TimeZone::SORT_BY_OFFSET, '(GMT{offset_prefix}{offset_formatted}) {timezone}');
$tzs = TimeZone::timezone_list(TimeZone::SORT_BY_OFFSET, '(GMT{offset_prefix}{offset_formatted})');
$tzs = TimeZone::timezone_list(TimeZone::SORT_BY_OFFSET, '(UTC{offset_prefix}{offset}) - {timezone}');
  • Usecase #4: using timezone output format template
echo TimeZone::timezone_format($timeZone)

NOTES

DOCUMENTS

SEE ALSO

TODO

Development roadmap

LICENSE

Timezone is released under the MIT license, see LICENSE file for details.