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

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

cahuk/server-timezone
=====================

Compatible Clock that gets server time from IP-based geolocation

v1.0.0(1y ago)24MITPHPPHP &gt;=8.3.0

Since May 29Pushed 1y agoCompare

[ Source](https://github.com/cahuk/server-timezone)[ Packagist](https://packagist.org/packages/cahuk/server-timezone)[ Docs](https://github.com/cahuk/server-timezone)[ RSS](/packages/cahuk-server-timezone/feed)WikiDiscussions master Synced today

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

ServerTimezone Resolver
=======================

[](#servertimezone-resolver)

A PHP package to resolve the current time based on an IP address using various external GeoIP and time APIs.

---

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

[](#installation)

```
composer require cahuk/server-timezone
```

Running Unit Tests
==================

[](#running-unit-tests)

Before running tests, clone the repository and install dependencies:

```
composer install
composer test

```

Usage Example
=============

[](#usage-example)

Below is a single comprehensive example demonstrating different approaches to resolve time based on IP:

```
