PHPackages                             libern/timezone - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. libern/timezone

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

libern/timezone
===============

Laravel Timezone Helpers

v1.0.3(8y ago)16.5k14MITPHPPHP &gt;=5.4.0

Since Dec 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/libern/Timezone)[ Packagist](https://packagist.org/packages/libern/timezone)[ Docs](https://github.com/libern/timezone)[ RSS](/packages/libern-timezone/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (5)Used By (4)

Laravel Timezone list data/options
==================================

[](#laravel-timezone-list-dataoptions)

This is a helper function that creates a select menu including timezones in human-readable format. Each underlying key is the php-friendly name for the timezone, making it easy to immediately store and use them. The array of timezones and their underlying keys were taken from the repository by [tamaspap](https://github.com/tamaspap/timezones).

Installation
------------

[](#installation)

Recommended installation of this package is through composer. Include the following in your project's `composer.json` file:

```
"require": {
	"libern/timezone": "dev-master"
}

```

Next, update Composer from the Terminal:

```
composer update

```

Once this operation completes, the final step is to add the service provider. Open `app/config/app.`, and add a new item to the service providers array.

```
'Libern\Timezone\TimezoneServiceProvider'

```

Now it's ready for use!

Usage
-----

[](#usage)

### Timezone Convert Helper Functions

[](#timezone-convert-helper-functions)

#### Timezone List

[](#timezone-list)

Simply get timezone array list:

```
$data = Timezone::getTimezoneInfoList();

```

#### Helpers

[](#helpers)

The package includes two helper functions that make it easy to deal with displaying and storing timezones, `convertFromUTC()` and `convertToUTC()`:

Each function accepts two required parameters and a third optional parameter dealing with the format of the returned timestamp.

```
convertFromUTC($timestamp, $timezone, $format);
convertToUTC($timestamp, $timezone, $format);

```

The first parameter accepts a timestamp, the second accepts the name of the timezone that you are converting to/from. The option values associated with the timezones included in the select form builder can be plugged into here as is. Alternatively, you can use any of [PHP's supported timezones](http://php.net/manual/en/timezones.php).

The third parameter is optional, and default is set to `'Y-m-d H:i:s'`, which is how Laravel natively stores datetimes into the database (the `created_at` and `updated_at` columns).

### Select Form Builder

[](#select-form-builder)

The package also includes a helper function for the creation of the select option. This is created by calling `Timezone::selectForm()`.

The method selectForm accepts four optional parameters, `string selected`, `placeholder`, `array formAttributes`, and `array optionAttributes`. An example of it's use is shown below:

```
$selected = 'US/Central';
$placeholder = 'Select a timezone';
$formAttributes = array('class' => 'swegForm', 'style' => 'float:left;', 'name' => 'timezone');
$optionAttributes = array('customValue' => 'true');

Timezone::selectForm($selected, $placeholder, $formAttributes, $optionAttributes);

```

Note that the `$selected` parameter matches the string to the values on each option, not the display text. The paratmeters `$formAttributes` and `$optionAttributes` can be used for styling, roles, and generally anything you need. This is useful for applying Twitter Bootstrap styling.

Simply returning `Timezone::selectForm()` will output the following:

```

(UTC-11:00) Midway Island
(UTC-11:00) Samoa
(UTC-10:00) Hawaii
(UTC-09:00) Alaska
(UTC-08:00) Pacific Time (US &amp; Canada)
(UTC-08:00) Tijuana
(UTC-07:00) Arizona
(UTC-07:00) Chihuahua
(UTC-07:00) La Paz
(UTC-07:00) Mazatlan
(UTC-07:00) Mountain Time (US &amp; Canada)
(UTC-06:00) Central America
(UTC-06:00) Central Time (US &amp; Canada)
(UTC-06:00) Guadalajara
(UTC-06:00) Mexico City
(UTC-06:00) Monterrey
(UTC-06:00) Saskatchewan
(UTC-05:00) Bogota
(UTC-05:00) Eastern Time (US &amp; Canada)
(UTC-05:00) Indiana (East)
(UTC-05:00) Lima
(UTC-05:00) Quito
(UTC-04:00) Atlantic Time (Canada)
(UTC-04:30) Caracas
(UTC-04:00) La Paz
(UTC-04:00) Santiago
(UTC-03:30) Newfoundland
(UTC-03:00) Brasilia
(UTC-03:00) Buenos Aires
(UTC-03:00) Georgetown
(UTC-03:00) Greenland
(UTC-02:00) Mid-Atlantic
(UTC-01:00) Azores
(UTC-01:00) Cape Verde Is.
(UTC+00:00) Casablanca
(UTC+00:00) Edinburgh
(UTC+00:00) Greenwich Mean Time : Dublin
(UTC+00:00) Lisbon
(UTC+00:00) London
(UTC+00:00) Monrovia
(UTC+00:00) UTC
(UTC+01:00) Amsterdam
(UTC+01:00) Belgrade
(UTC+01:00) Berlin
(UTC+01:00) Bern
(UTC+01:00) Bratislava
(UTC+01:00) Brussels
(UTC+01:00) Budapest
(UTC+01:00) Copenhagen
(UTC+01:00) Ljubljana
(UTC+01:00) Madrid
(UTC+01:00) Paris
(UTC+01:00) Prague
(UTC+01:00) Rome
(UTC+01:00) Sarajevo
(UTC+01:00) Skopje
(UTC+01:00) Stockholm
(UTC+01:00) Vienna
(UTC+01:00) Warsaw
(UTC+01:00) West Central Africa
(UTC+01:00) Zagreb
(UTC+02:00) Athens
(UTC+02:00) Bucharest
(UTC+02:00) Cairo
(UTC+02:00) Harare
(UTC+02:00) Helsinki
(UTC+02:00) Istanbul
(UTC+02:00) Jerusalem
(UTC+02:00) Kyiv
(UTC+02:00) Pretoria
(UTC+02:00) Riga
(UTC+02:00) Sofia
(UTC+02:00) Tallinn
(UTC+02:00) Vilnius
(UTC+03:00) Baghdad
(UTC+03:00) Kuwait
(UTC+03:00) Minsk
(UTC+03:00) Nairobi
(UTC+03:00) Riyadh
(UTC+03:00) Volgograd
(UTC+03:30) Tehran
(UTC+04:00) Abu Dhabi
(UTC+04:00) Baku
(UTC+04:00) Moscow
(UTC+04:00) Muscat
(UTC+04:00) St. Petersburg
(UTC+04:00) Tbilisi
(UTC+04:00) Yerevan
(UTC+04:30) Kabul
(UTC+05:00) Islamabad
(UTC+05:00) Karachi
(UTC+05:00) Tashkent
(UTC+05:30) Chennai
(UTC+05:30) Kolkata
(UTC+05:30) Mumbai
(UTC+05:30) New Delhi
(UTC+05:30) Sri Jayawardenepura
(UTC+05:45) Kathmandu
(UTC+06:00) Almaty
(UTC+06:00) Astana
(UTC+06:00) Dhaka
(UTC+06:00) Ekaterinburg
(UTC+06:30) Rangoon
(UTC+07:00) Bangkok
(UTC+07:00) Hanoi
(UTC+07:00) Jakarta
(UTC+07:00) Novosibirsk
(UTC+08:00) Beijing
(UTC+08:00) Chongqing
(UTC+08:00) Hong Kong
(UTC+08:00) Krasnoyarsk
(UTC+08:00) Kuala Lumpur
(UTC+08:00) Perth
(UTC+08:00) Singapore
(UTC+08:00) Taipei
(UTC+08:00) Ulaan Bataar
(UTC+08:00) Urumqi
(UTC+09:00) Irkutsk
(UTC+09:00) Osaka
(UTC+09:00) Sapporo
(UTC+09:00) Seoul
(UTC+09:00) Tokyo
(UTC+09:30) Adelaide
(UTC+09:30) Darwin
(UTC+10:00) Brisbane
(UTC+10:00) Canberra
(UTC+10:00) Guam
(UTC+10:00) Hobart
(UTC+10:00) Melbourne
(UTC+10:00) Port Moresby
(UTC+10:00) Sydney
(UTC+10:00) Yakutsk
(UTC+11:00) Vladivostok
(UTC+12:00) Auckland
(UTC+12:00) Fiji
(UTC+12:00) International Date Line West
(UTC+12:00) Kamchatka
(UTC+12:00) Magadan
(UTC+12:00) Marshall Is.
(UTC+12:00) New Caledonia
(UTC+12:00) Solomon Is.
(UTC+12:00) Wellington
(UTC+13:00) Nuku'alofa

```

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~295 days

Total

4

Last Release

2976d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/420da8717b27611ef8f553e2d143c4757e6e210fa56cc31fd6976b178956379b?d=identicon)[libern](/maintainers/libern)

---

Top Contributors

[![libern](https://avatars.githubusercontent.com/u/1830640?v=4)](https://github.com/libern "libern (7 commits)")

### Embed Badge

![Health badge](/badges/libern-timezone/health.svg)

```
[![Health](https://phpackages.com/badges/libern-timezone/health.svg)](https://phpackages.com/packages/libern-timezone)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M11](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M375](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M136](/packages/illuminate-cookie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
