PHPackages                             virtual-web-studio/geo-clock - 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. virtual-web-studio/geo-clock

ActiveLibrary

virtual-web-studio/geo-clock
============================

PSR-20 Clock implementation that returns current time based on server geolocation

v1.0.0(12mo ago)02MITPHPPHP ^8.4

Since May 21Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/Virtual-Web-Studio/geo-clock)[ Packagist](https://packagist.org/packages/virtual-web-studio/geo-clock)[ RSS](/packages/virtual-web-studio-geo-clock/feed)WikiDiscussions main Synced 1mo ago

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

GeoClock
========

[](#geoclock)

GeoClock is a lightweight PHP library implementing the [PSR-20 `ClockInterface`](https://www.php-fig.org/psr/psr-20/).

It provides the current time in the server’s geographical time zone using its public IP address, by querying the [`ipgeolocation.io`](https://ipgeolocation.io) API.

---

Features
--------

[](#features)

- PSR-20 compatible `ClockInterface`
- Returns accurate time based on geolocation
- Automatically detects the public IP of the server
- Allows manually overriding the IP address
- Falls back to UTC on error
- Minimal dependencies

---

⚠️ API Key Required
-------------------

[](#️-api-key-required)

This library uses the [`ipgeolocation.io`](https://ipgeolocation.io) API to resolve timezone and current time.
You **must provide a valid API key** when instantiating the clock.

To get an API key:

1. Register at
2. Copy your key from the dashboard
3. Use it like this:

```
use GeoClock\GeoClock;

$clock = new GeoClock('your_api_key');
echo $clock->now()->format('c'); // ISO 8601 output
```

You can also specify a known IP manually:

```
$clock = new GeoClock('your_api_key', '8.8.8.8');
```

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

[](#installation)

Recommended (after stable tag is released):

```
composer require virtual-web-studio/geo-clock
```

Development version (if using dev-main):

```
composer require virtual-web-studio/geo-clock:dev-main --with-all-dependencies
```

Testing
-------

[](#testing)

To run tests:

```
make test
```

License
-------

[](#license)

MIT — see LICENSE

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance50

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d49f092e4c28e50876acb0fb701f868a3661c65cfe6e8adc431311ee98d5807?d=identicon)[SerVIRUS](/maintainers/SerVIRUS)

---

Top Contributors

[![SerVIRUS](https://avatars.githubusercontent.com/u/7392443?v=4)](https://github.com/SerVIRUS "SerVIRUS (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/virtual-web-studio-geo-clock/health.svg)

```
[![Health](https://phpackages.com/badges/virtual-web-studio-geo-clock/health.svg)](https://phpackages.com/packages/virtual-web-studio-geo-clock)
```

###  Alternatives

[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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