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

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

p3k/timezone
============

Find the timezone of a given location

0.1.0(9y ago)424.4k↓15.5%[1 issues](https://github.com/aaronpk/p3k-timezone/issues)1Apache-2.0PHPPHP &gt;=5.4.0

Since Jan 12Pushed 9y ago2 watchersCompare

[ Source](https://github.com/aaronpk/p3k-timezone)[ Packagist](https://packagist.org/packages/p3k/timezone)[ Docs](https://github.com/aaronpk/p3k-timezone)[ RSS](/packages/p3k-timezone/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

Timezone
========

[](#timezone)

This library provides a function for retrieving the timezone for a given location.

It is implemented as a single file with no external dependencies. To do this, a horrible cheat is used. The timezone for a location is found by looking up the timezone of the nearest city. This means it's possible that the wrong timezone will be returned for locations near the borders between timezones, so you should only use this library if that is an acceptable compromise. The tradeoff is no fancy geometry or databases are required so this is comparatively fast.

API
---

[](#api)

```
$timezone = p3k\Timezone::timezone_for_location($latitude, $longitude);
```

Returns a string with the timezone name such as "Europe/Berlin", which can be used to create a new `DateTimeZone` object.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

3413d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/385b302aef27e9e72ddfbf65c8b15cfce5946744fe2e541c5b415665fc2351fc?d=identicon)[aaronpk](/maintainers/aaronpk)

---

Top Contributors

[![aaronpk](https://avatars.githubusercontent.com/u/113001?v=4)](https://github.com/aaronpk "aaronpk (2 commits)")

---

Tags

indiewebp3ktimezonedatetimezonep3k

### Embed Badge

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

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

###  Alternatives

[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14282.3k](/packages/dater-dater)[icanboogie/datetime

Extends the features of PHP DateTime and DateTimeZone

51345.7k3](/packages/icanboogie-datetime)[fresh/datetime

PHP library that provides additional functions for processing dates &amp; times.

17513.8k2](/packages/fresh-datetime)

PHPackages © 2026

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