PHPackages                             namnv609/timezonedb-php-api - 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. [Database &amp; ORM](/categories/database)
4. /
5. namnv609/timezonedb-php-api

ActiveLibrary[Database &amp; ORM](/categories/database)

namnv609/timezonedb-php-api
===========================

PHP API client for TimeZoneDB.com

v1.0(8y ago)19.5k1MITPHPPHP &gt;=5.5CI failing

Since Jun 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/namnv609/timezonedb-php-api)[ Packagist](https://packagist.org/packages/namnv609/timezonedb-php-api)[ RSS](/packages/namnv609-timezonedb-php-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

TimeZoneDB API
==============

[](#timezonedb-api)

> TimeZoneDB provides free time zone database for cities of the world. The database is licensed under Creative Commons Attribution 3.0 License. It contains countries name, time zones, abbreviation, GMT offset, and Daylight Saving Time (DST). The data is available in CSV and SQL format. You can download and implement into your projects for free.

System requirements
-------------------

[](#system-requirements)

- **PHP &gt;= 5.5**

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

[](#installation)

Using Composer

- `composer install namnv609/timezonedb-php-api`

or you can include the following in your `composer.json`

- `"namnv609/timezonedb-php-api": "1.0"`

Usage Instructions
------------------

[](#usage-instructions)

First, create new `TimeZoneDB` instance to make configuring the library for usage.

```
use NNV\TimeZoneDB;

$tzDB = new TimeZoneDB();
```

Once the `TimeZoneDB` instance has been registered. You may use it like so:

### [List Time Zone](https://timezonedb.com/references/list-time-zone)

[](#list-time-zone)

> List out all available time zones supported by TimeZoneDB.

```
$listTimeZoneParams = [
    "fields" => "countryCode,countryName",
    "country" => "NZ",
    // Other params
];
$tzDB->listTimeZone($listTimeZoneParams);
```

### [Get Time Zone](https://timezonedb.com/references/get-time-zone)

[](#get-time-zone)

> Get local time of a city by its name, time zone, latitude &amp; longtiude, or IP address.

```
$getTimeZoneParams = [
    "by" => "zone",
    "zone" => "America/Chicago",
    // Other params
];
$tzDB->getTimeZone($getTimeZoneParams);
```

### [Convert Time Zone](https://timezonedb.com/references/convert-time-zone)

[](#convert-time-zone)

> Convert timestamp between two different time zone.

```
$convertTimeZoneParams = [
    "from" => "America/Los_Angeles",
    "to" => "Australia/Sydney",
    "time" => "06/01/2016 03:00PM", // You can use standard DateTime format or Unix time
    // Other params
];
$tzDB->convertTimeZone($convertTimeZoneParams);
```

### Utilities

[](#utilities)

We support some utilities function for your usage like:

#### listTimeZones

[](#listtimezones)

> List of time zones supported by TimeZoneDB

```
$tzDB->listTimeZones();
```

#### codeToZones

[](#codetozones)

> Convert country code to time zones

```
$tzDB->codeToZones("AQ");

// Result
[
    8 => "Antarctica/Casey",
    9 => "Antarctica/Davis",
    10 => "Antarctica/DumontDUrville",
    11 => "Antarctica/Mawson",
    12 => "Antarctica/McMurdo",
    13 => "Antarctica/Palmer",
    14 => "Antarctica/Rothera",
    15 => "Antarctica/Syowa",
    16 => "Antarctica/Troll",
    17 => "Antarctica/Vostok",
]
```

#### countryToZones

[](#countrytozones)

> Country name to time zones

```
$tzDB->countryToZones("Vietnam");

// Result
[
    418 => "Asia/Ho_Chi_Minh",
]
```

#### zoneToCode

[](#zonetocode)

> Time zone to country code

```
$tzDB->zoneToCode("Asia/Ho_Chi_Minh");

// Result
"VN"
```

#### zoneToCountry

[](#zonetocountry)

> Time zone to country name

```
$tzDB->zoneToCountry("Asia/Ho_Chi_Minh");

// Result
"Vietnam"
```

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

3243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cf7a9f1c6e9a9c3bd89c2f178e8a2d71e982df8c05cff8036209cc5f46643f09?d=identicon)[namnv609](/maintainers/namnv609)

---

Top Contributors

[![namnv609](https://avatars.githubusercontent.com/u/8691772?v=4)](https://github.com/namnv609 "namnv609 (22 commits)")

---

Tags

citycountriesdatabasephptimezonedbtimezonedb-apizonezones-supportedRESTful APItime zonetimezonedb.comconvert time zone

### Embed Badge

![Health badge](/badges/namnv609-timezonedb-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/namnv609-timezonedb-php-api/health.svg)](https://phpackages.com/packages/namnv609-timezonedb-php-api)
```

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[a2lix/translation-form-bundle

Translate your doctrine objects easily with some helpers

3376.9M38](/packages/a2lix-translation-form-bundle)[damienharper/auditor

The missing audit log library.

1922.8M8](/packages/damienharper-auditor)[omines/datatables-bundle

Symfony DataTables Bundle with native Doctrine ORM, Elastica and MongoDB support

2851.4M6](/packages/omines-datatables-bundle)[tpetry/laravel-mysql-explain

Get Visual MySQL EXPLAIN for Laravel.

264154.2k](/packages/tpetry-laravel-mysql-explain)[guanguans/notify

Push notification SDK(AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

682104.9k7](/packages/guanguans-notify)

PHPackages © 2026

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