baspa/laravel-timezones

Laravel package to generate arrays of available timezones to be used in lists.
22,518 2
Install
composer require baspa/laravel-timezones
Latest Version:v1.5.0
PHP:^8.2|^8.3|^8.4
Laravel:11 · 12 · 13
Older releases:10
License:MIT
Last Updated:Oct 13, 2026
Links: GitHub  ·  Packagist
Maintainer: Baspa

Banner

Laravel package to generate arrays of available timezones to be used in lists.

Latest Version on Packagist GitHub Tests Action Status Code Coverage GitHub Code Style Action Status Total Downloads

The Laravel Timezones package is a convenient solution for Laravel developers who need to include a dropdown menu of timezones in their applications. This package simplifies the process of incorporating a timezone selection feature, saving developers valuable time and effort.

Installation

You can install the package via composer:

composer require baspa/laravel-timezones

Usage

Timezones grouped by continent

use Baspa\Timezones\Facades\Timezones;
// 
$groupedTimezones = Timezones::toArray(grouped: true);

All timezones

use Baspa\Timezones\Facades\Timezones;
// 
$timezones = Timezones::toArray();

Exclude continents

use Baspa\Timezones\Facades\Timezones;
// 
$timezones = Timezones::excludeContinents(['Africa', 'America'])
    ->toArray();

Show offset

$timezones = Timezones::showOffset()->toArray();
// or
$timezones = Timezones::showOffset(showOffset: false)->toArray();

Include general timezones

To include general timezones like GMT or UTC use the includeGeneral method.

$timezones = Timezones::includeGeneral()->toArray();

Show country names

To include country names alongside timezone labels use the showCountry method. This uses PHP's built-in timezone data combined with the league/iso3166 package to provide accurate country names.

// Basic usage with country names
$timezones = Timezones::showCountry()->toArray();
// Output: "Amsterdam (Netherlands)"

// Combined with other methods
$timezones = Timezones::showCountry()
    ->showOffset(false)
    ->toArray();
// Output: "Amsterdam (Netherlands)"

// With full continent names preserved
$timezones = Timezones::showCountry()->toArrayWithContinents();
// Output: "Europe / Amsterdam (Netherlands)"

// Grouped by continent with country names
$timezones = Timezones::showCountry()->toArray(grouped: true);

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

baspa/filament-canary

A runtime smoke-sweep that asserts every Filament page mounts and authorizes, en...

7,192 8
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

644,549,754 9,698
laravel/framework

The Laravel Framework.

598,760,099 34,966
laravel/tinker

Powerful REPL for the Laravel framework.

507,193,856 7,441
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

423,477,751 607

Version History

Version Released PHP Laravel License
v1.5.0 ^8.2|^8.3|^8.4 ^11.0 || ^12.0 || ^13.0 MIT
v1.4.0 ^8.2|^8.3|^8.4 ^10.0 || ^11.0 || ^12.0 || ^13.0 MIT
v1.3.3 ^8.1|^8.2 ^10.0 || ^11.0 || ^12.0 MIT
v1.3.2 ^8.1|^8.2 ^10.0 || ^11.0 || ^12.0 MIT
v1.3.1 ^8.1|^8.2 ^10.0 || ^11.0 || ^12.0 MIT