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

ActiveLibrary

ivan-berger/server-timezone
===========================

Get server time based on IP timezone

1.0.0(1y ago)06PHPPHP ^8.4

Since Mar 19Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rchitector/ServerTimeZone)[ Packagist](https://packagist.org/packages/ivan-berger/server-timezone)[ RSS](/packages/ivan-berger-server-timezone/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Server Time Zone
================

[](#server-time-zone)

This is a test project to retrieve the server's current time based on the provided IP address.

Description
-----------

[](#description)

The project includes a `ServerTimeZone` class that provides functionality to get the current server time using the IP address. It uses an external time API to fetch the current time and timezone information.

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

[](#installation)

1. Clone the repository: ```
    git clone https://github.com/rchitector/ServerTimeZone.git
    ```
2. Navigate to the project directory: ```
    cd ServerTimeZone
    ```
3. Install the dependencies using Composer: ```
    composer install
    ```

Usage
-----

[](#usage)

To get the current server time based on the provided IP address, you can use the `ServerTimeZone` class:

```
use IvanBerger\ServerTimeZone\IPProvider;
use IvanBerger\ServerTimeZone\TimeServiceException;
use IvanBerger\ServerTimeZone\ServerTimeZone;

try {
    $ipProvider = new IPProvider();
    $ip = $ipProvider->detectIP();
    echo 'Current IP detected: ' . $ip . PHP_EOL;
    $serverTime = new ServerTimeZone($ip);
    $cdt = $serverTime->getCurrentDateTime();
    echo 'Current server time detected: ' . $cdt->format('Y-m-d H:i:s P');
} catch (TimeServiceException $e) {
    echo 'Error: '.$e->getMessage();
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance45

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5686b0c1e2e94498253dd2a85f8d9254224b01a865f18d6ea565fa4b7c03360a?d=identicon)[r.chitector](/maintainers/r.chitector)

---

Top Contributors

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

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ivan-berger-server-timezone/health.svg)

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

PHPackages © 2026

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