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

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

getwarp/clock
=============

Enhanced DateTime classes and Clock API implementation

3.1.4(3y ago)1799MITPHPPHP ^7.4|^8.0

Since Apr 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/getwarp/clock)[ Packagist](https://packagist.org/packages/getwarp/clock)[ Docs](https://github.com/getwarp/clock)[ GitHub Sponsors](https://github.com/getwarp)[ GitHub Sponsors](https://github.com/hustlahusky)[ RSS](/packages/getwarp-clock/feed)WikiDiscussions 3.1.x Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

getwarp/clock
=============

[](#getwarpclock)

Enhanced **DateTime** classes and **Clock** API implementation

[GitHub](https://github.com/getwarp/clock) • [Packagist](https://packagist.org/packages/getwarp/clock) • [Installation](#installation) • [Usage](#usage)

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

[](#installation)

Via Composer

```
composer require getwarp/clock
```

Usage
-----

[](#usage)

DateTime:

```
use Warp\Clock\DateTimeImmutableValue;

$time = DateTimeImmutableValue::now();
// $time = DateTimeImmutableValue::from('2020-02-02 20:22:02');
// $time = DateTimeImmutableValue::from(3 * DateTimeImmutableValue::HOUR); // now + 3 hours

\assert($time instanceof \DateTimeImmutable);

echo (string)$time;
// 2020-02-02 20:22:02
echo \json_encode($time);
// 2020-02-02T20:22:02+00:00
```

Clock:

```
use Warp\Clock\FrozenClock;
use Warp\Clock\SystemClock;

$clock = new FrozenClock(SystemClock::fromUTC());
$startedAt = $clock->now();
\sleep(5);
$finishedAt = $clock->now();
\assert($startedAt === $finishedAt);

$clock->reset();
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

[Report issues](https://github.com/getwarp/warp/issues) and [send pull requests](https://github.com/getwarp/warp/pulls) in the [main Warp repository](https://github.com/getwarp/warp). Please see [contributing guide](https://github.com/getwarp/warp/blob/3.1.x/CONTRIBUTING.md) and [code of conduct](https://github.com/getwarp/.github/blob/main/CODE_OF_CONDUCT.md) for details.

Credits
-------

[](#credits)

- [Constantine Karnaukhov](https://github.com/hustlahusky)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [license file](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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

Every ~96 days

Total

5

Last Release

1102d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3947942?v=4)[Constantine Karnaukhov](/maintainers/tntrex)[@tntrex](https://github.com/tntrex)

---

Top Contributors

[![tntrex](https://avatars.githubusercontent.com/u/3947942?v=4)](https://github.com/tntrex "tntrex (6 commits)")

---

Tags

clockdatetimetimedate

### Embed Badge

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

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

###  Alternatives

[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[tplaner/when

Date/Calendar recursion library.

5261.0M5](/packages/tplaner-when)[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)

PHPackages © 2026

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