PHPackages                             sergeyakovlev/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. sergeyakovlev/clock

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

sergeyakovlev/clock
===================

Implementation of the PSR-20 Clock Interface

1.0.0(3y ago)111MITPHPPHP ^8.0

Since Apr 1Pushed 1y ago1 watchersCompare

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

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

Clock
=====

[](#clock)

Implementation of the PSR-20 Clock Interface.

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

[](#installation)

Install via [Composer](https://getcomposer.org/):

```
$ composer require sergeyakovlev/clock
```

Usage
-----

[](#usage)

### System Clock

[](#system-clock)

The current time with default time zone:

```
use SergeYakovlev\Clock\SystemClock;

$clock = new SystemClock();

echo $clock->now()->format('c');
```

The current time with the specified time zone:

```
use DateTimeZone;
use SergeYakovlev\Clock\SystemClock;

$clock = new SystemClock(
    new DateTimeZone('UTC')
);

echo $clock->now()->format('c');
```

### Frozen Clock

[](#frozen-clock)

The specified time:

```
use DateTimeImmutable;
use SergeYakovlev\Clock\FrozenClock;

$clock = new FrozenClock(
    new DateTimeImmutable('2001-02-03T04:05:06+07:00')
);

echo $clock->now()->format('c'); // 2001-02-03T04:05:06+07:00
```

Links
-----

[](#links)

- PHP-FIG.org: [PSR-20 Clock](https://www.php-fig.org/psr/psr-20/)
- GitHub: [PSR Clock](https://github.com/php-fig/clock)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

1144d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/750c80b87297ae684525a6cb6e3296c08509673f3b1911122c00a6f7757dfa58?d=identicon)[sergeyakovlev](/maintainers/sergeyakovlev)

---

Top Contributors

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

---

Tags

clockdatedatetimedatetimeimmutabledatetimezoneimplementationphppsr-20psr20systemtimephpclockpsr20psr-20datetimetimedatesystemdatetimeimmutableimplementationDateTimeZone

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sergeyakovlev-clock/health.svg)

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

###  Alternatives

[symfony/clock

Decouples applications from the system clock

431168.9M205](/packages/symfony-clock)[beste/clock

A collection of Clock implementations

7423.3M20](/packages/beste-clock)[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.5M3](/packages/kartik-v-php-date-formatter)[dater/dater

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

14282.3k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21128.6k1](/packages/zjkal-time-helper)

PHPackages © 2026

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