PHPackages                             charlesportwoodii/geo-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. charlesportwoodii/geo-timezone

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

charlesportwoodii/geo-timezone
==============================

PHP library for timezone calculation from a particular location and date.

1.0.3(8y ago)0152PHPPHP &gt;=7.0

Since Aug 31Pushed 7y ago1 watchersCompare

[ Source](https://github.com/charlesportwoodii/geo-timezone)[ Packagist](https://packagist.org/packages/charlesportwoodii/geo-timezone)[ Docs](http://minube.com)[ RSS](/packages/charlesportwoodii-geo-timezone/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (7)Used By (0)

Geo-Timezone PHP Library
========================

[](#geo-timezone-php-library)

[![Build Status](https://camo.githubusercontent.com/a6652a143446b174ed628e31cbdcdd30c2ed8c3e19e5d63f0cb5423a651fc333/68747470733a2f2f7472617669732d63692e6f72672f6d696e7562652f67656f2d74696d657a6f6e652e706e67)](https://travis-ci.org/minube/geo-timezone) [![Code Coverage](https://camo.githubusercontent.com/1773142622cea5dacee8b55e12931d854b6aa3ce862272185572b5058d4a5c84/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696e7562652f67656f2d74696d657a6f6e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/minube/geo-timezone/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/5db77b0a5233cc41fa9d2fb312085a3162e41b25bbb33675c83a54420ba21d29/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696e7562652f67656f2d74696d657a6f6e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/minube/geo-timezone/?branch=master) [![Build Status](https://camo.githubusercontent.com/58036dd67aa4c0d149591fdf780ef0c870ec37a131daa908e6a8f4e79b59006d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d696e7562652f67656f2d74696d657a6f6e652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/minube/geo-timezone/build-status/master)

Based on the [node-geo-tz package](https://github.com/evansiroky/node-geo-tz), this PHP library calculates the timezone associated to a particular location based on coordinates (latitude, longitude) and timestamp reference. Therefore, this library provides the local date of a particular location in any moment too. In addition, it is based on the timezones boundaries extracted by [timezone-boundary-builder](https://github.com/evansiroky/timezone-boundary-builder) tool, so it is necessary to always use the latest version of this package. In order to improve the timezone search through the boundaries, node-geo-tz proposes to create a tree of directories based on dividing the Earth in quadrants and sub-quadrants iteratively. This tree is called "data.zip" in the reference library.

Requirements
------------

[](#requirements)

GEOS PHP extension is needed to run library. So, you should download and compile it running the script bin/compile-geos .sh; then, the library called "geos.so" will be added to /usr/lib/php. As you can see, this script contains the installation of some php extensions that will be necessary in the next step of the installation process.

Once you have compiled the GEOS PHP extension, you should create the file geos.ini in order to enable the module and improve the performance consequently.

Finally, you should run the composer file, so the rest of necessary libraries will be installed.

Usage
-----

[](#usage)

There are two main classes:

- UpdaterData: script that downloads the last version of the timezone boundaries data and creates the tree of directories (data.zip). It takes a few hours, so you can use "data.zip" from node-geo-tz to test for the first time. Otherwise, you can run the UpdaterData script in order to get the last version and create the directories tree. Destination folder must have write permisions

```
    use GeoTimeZone\UpdaterData;

    $updater = new UpdaterData("/path/to/data/");
    $updater->updateData();
```

- Calculator: provides the timezone name or the local date associated to a particular latitude, longitude and timestamp.

```
    use GeoTimeZone\Calculator;

    $latitude = 39.452800;
    $longitude = -0.347038;
    $timestamp = 1469387760;

    $calculator = new Calculator("/path/to/data/");

    // Local date
    $localDate = $calculator->getLocalDate($latitude, $longitude, $timestamp);
    /* DateTime Object
    (
        [date] => 2016-07-24 21:16:00.000000
        [timezone_type] => 3
        [timezone] => Europe/Madrid
    )
    */

    // TimeZone name
    $timeZoneName = $calculator->getTimeZoneName($latitude, $longitude);
    //Europe/Madrid
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 90.5% 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 ~9 days

Total

4

Last Release

3148d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/630969?v=4)[Charles R. Portwood II](/maintainers/charlesportwoodii)[@charlesportwoodii](https://github.com/charlesportwoodii)

---

Top Contributors

[![abmo](https://avatars.githubusercontent.com/u/15795778?v=4)](https://github.com/abmo "abmo (114 commits)")[![fjalvarezdd](https://avatars.githubusercontent.com/u/1707308?v=4)](https://github.com/fjalvarezdd "fjalvarezdd (6 commits)")[![JustHarris](https://avatars.githubusercontent.com/u/8626468?v=4)](https://github.com/JustHarris "JustHarris (3 commits)")[![charlesportwoodii](https://avatars.githubusercontent.com/u/630969?v=4)](https://github.com/charlesportwoodii "charlesportwoodii (2 commits)")[![inakivb](https://avatars.githubusercontent.com/u/8626495?v=4)](https://github.com/inakivb "inakivb (1 commits)")

### Embed Badge

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

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

###  Alternatives

[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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