PHPackages                             henshall/timezones - 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. henshall/timezones

ActiveLibrary

henshall/timezones
==================

Package for use with mysql timezone-tables

06PHP

Since May 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Henshall/timezones)[ Packagist](https://packagist.org/packages/henshall/timezones)[ RSS](/packages/henshall-timezones/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Timezone Package for Mysql
==========================

[](#timezone-package-for-mysql)

Version: 1.0.0
--------------

[](#version-100)

This is a simple timezone package for use with php and mysql timezone tables. It allows you to get the current timezone, get the time in any timezone now, and generate a list of all possible timezones and their current time. This is great for creating applications which are required to know what timezone the user is in such as scheduling applications.

Installation:
-------------

[](#installation)

1. Install timezone tables for mysql
2. run composer require henshall\\timezones

Usage:
------

[](#usage)

Use this to get and get your local timezone. Read the notes below on setting timezones.

```
$timezone = new Timezone("localhost", "username", "password", "database_name", "local_timezone(optional)");
$timezone->set_local_timezone("Europe/Moscow");
$local_timezone = $timezone->get_local_timezone();
```

Get array of all Timezones and their current times

```
$timezone = new Timezone("localhost", "username", "password", "database_name", "local_timezone(optional)");
$timezone->get_timezones_and_current_times()
```

Get local current time in a specific timezone

```
$timezone = new Timezone("localhost", "username", "password", "database_name", "local_timezone(optional)");
$japan_time = $timezone->get_time_now("Japan");
```

NOTES:
------

[](#notes)

- Your computers clock must be set correctly. If your clock it not set correctly, the timezone calculations will be wrong.
- The local timezone (find with get\_local\_timezone()) must be your current timezone. If the timezone is wrong, the calculations will also be wrong.
- This application will automatically determine your current timezone using the mysql tables, if it does this improperly, you may need to set it manually as shown in the examples above.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/90d8f0c734f4da644d2356081c7f4d750a11b42c1ca448091853cbe95bc38d27?d=identicon)[weshenshall](/maintainers/weshenshall)

---

Top Contributors

[![Henshall](https://avatars.githubusercontent.com/u/20879253?v=4)](https://github.com/Henshall "Henshall (14 commits)")

### Embed Badge

![Health badge](/badges/henshall-timezones/health.svg)

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

PHPackages © 2026

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