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. [Utility &amp; Helpers](/categories/utility)
4. /
5. virtual-web-studio/geo-clock

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

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

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

v1.0.0(1y ago)02MITPHPPHP ^8.4

Since May 21Pushed 1y 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 today

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

29

—

LowBetter than 57% of packages

Maintenance46

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

408d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7392443?v=4)[VIRUS](/maintainers/SerVIRUS)[@SerVIRUS](https://github.com/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

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

564576.7k52](/packages/ecotone-ecotone)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)

PHPackages © 2026

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