2017 © Pedro Peláez
 

library friendlytimezone

Friendly timezones for php

image

nehero/friendlytimezone

Friendly timezones for php

  • Sunday, January 1, 2017
  • by nehero
  • Repository
  • 1 Watchers
  • 9 Stars
  • 4,436 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 18 % Grown

The README.md

User-friendly timezones for PHP

List extracted from Microsoft Time Zone Index Values., (*1)

Some regions influenced by this Stack Overflow answer., (*2)

Contributing

If you have a better suggestion for some of the mapped regions, please submit a pull request with the changes and accurate sources for the changes., (*3)

Usage:

composer install nehero/friendlytimezone, (*4)


// autoload / require_once the file here require_once __DIR__ . '/vendor/autoload.php'; // If you want for dependency injection / OO // use Nehero\FriendlyTimezone; // But it's easiest to use statically use Nehero\FriendlyTimezone\Facade as FriendlyTimezone; // If no options are passed to get(), values are sorted by `asc` GMT offset value $timezones = FriendlyTimezone::get(); // You can also optionally pass an array of options // ex. $timezones = FriendlyTimezone::get([ 'order' => 'desc' ]); $timezones = FriendlyTimezone::get([ 'order' => 'asc' ]); /** * $timezones is an associative array in the format * Friendly Label => Php Timezone String * * ex. * [ * '(GMT-6:00) Saskatchewan' => 'America/Regina' * ] */

Example HTML usage, (*5)

<select name="timezones">
    <?php foreach($timezones as $label => $value): ?>
        <option value="<?php echo $value; ?>"><?php echo $label; ?></option>
    <?php endforeach; ?>
</select>

The Versions

01/01 2017

dev-master

9999999-dev

Friendly timezones for php

  Sources   Download

MIT

by Ozzie Neher

01/01 2017

2.0.1

2.0.1.0

Friendly timezones for php

  Sources   Download

MIT

by Ozzie Neher

31/12 2016

2.0

2.0.0.0

Friendly timezones for php

  Sources   Download

MIT

by Ozzie Neher

30/12 2016

1.1

1.1.0.0

Friendly timezones for php

  Sources   Download

MIT

by Ozzie Neher

28/12 2016

1.0

1.0.0.0

Friendly timezones for php

  Sources   Download

MIT

by Ozzie Neher