PHPackages                             iserv/zeit - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. iserv/zeit

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

iserv/zeit
==========

An all purpose library for date and time handling.

v1.3(2y ago)21.1k1MITPHPPHP &gt;=8.1

Since Apr 9Pushed 9mo ago5 watchersCompare

[ Source](https://github.com/IServ-GmbH/zeit)[ Packagist](https://packagist.org/packages/iserv/zeit)[ RSS](/packages/iserv-zeit/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (18)Used By (1)

IServ Zeit Library
==================

[](#iserv-zeit-library)

Usage
-----

[](#usage)

### Zeit and Clock

[](#zeit-and-clock)

The Zeit library offers you some assitance in handling date and time related information. One the one side we have the `Zeit` util and a `Clock` which can be asked for the current time. It will use the system clock by default, but a fixed value can be injected for testing.

```
use IServ\Library\Zeit\Clock\FixedClock;
use IServ\Library\Zeit\Zeit;

$now = Zeit::now();
printf("It is %s o'clock", $now->format('H'));

Zeit::setClock(FixedClock::fromString('2021-04-23 12:00:00'));

$now = Zeit::now();
printf("It is %s o'clock", $now->format('H'));
 // Will print 12 o'clock
```

The `Clock` is an extension of the [PSR-20: Clock](https://www.php-fig.org/psr/psr-20/) adding the option to `usleep` the clock so that you can do time elapsing testing, too.

### Date and Time

[](#date-and-time)

The library also offers `Date` and `Time` domain objects. These can be used to model only relevant data where you'd normally rely on PHP's built-in DateTime objects. The models can be converted to DateTime objects for further processing, but keep in mind that PHP will add the missing parts for you.

```
use IServ\Library\Zeit\Date;
use IServ\Library\Zeit\Time;

$date = Date::fromParts(2021, 4, 23);
echo $date->getValue();
// will print the normalized string representation "2021-04-23"

$time = Time::fromParts(10, 37); // The third parameter for seconds is optional and defaults to zero
echo $time->getValue();
// will print the normalized string representation "10:37:00"

// You can merge a Date and a Time to \DateTimeImmutable
$dateTime = $date->withTime($time);
echo $dateTime->format('Y:m:d H:i:s');
// will print "2021-04-23 10:37:00"
```

The real power of `Date` and `Time` can be leveraged with the `ZeitBridge` component which integrates the library into your Doctrine/Symfony project and allows to map the Zeit models into entities and forms directly.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance41

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~137 days

Recently: every ~203 days

Total

7

Last Release

1085d ago

PHP version history (2 changes)v1.0-RC1PHP &gt;=7.3

v1.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e47096095e08fa7cc521826f5ab3c09f1c5ad7f9a0d26062a5aa31e0d0078b4?d=identicon)[iserv](/maintainers/iserv)

---

Top Contributors

[![althaus](https://avatars.githubusercontent.com/u/105975?v=4)](https://github.com/althaus "althaus (8 commits)")[![DomSieIServ](https://avatars.githubusercontent.com/u/131360524?v=4)](https://github.com/DomSieIServ "DomSieIServ (2 commits)")[![FelixJacobi](https://avatars.githubusercontent.com/u/25072300?v=4)](https://github.com/FelixJacobi "FelixJacobi (1 commits)")[![hype09](https://avatars.githubusercontent.com/u/6646802?v=4)](https://github.com/hype09 "hype09 (1 commits)")

---

Tags

datedatetimephptimezeitpsrclockpsr-20timedate

### Embed Badge

![Health badge](/badges/iserv-zeit/health.svg)

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

###  Alternatives

[psr/clock

Common interface for reading the clock.

646378.5M528](/packages/psr-clock)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

185701.7M5.6k](/packages/nesbot-carbon)[cakephp/chronos

A simple API extension for DateTime.

1.4k50.2M145](/packages/cakephp-chronos)[symfony/clock

Decouples applications from the system clock

436205.7M391](/packages/symfony-clock)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[stella-maris/clock

A pre-release of the proposed PSR-20 Clock-Interface

7949.7M2](/packages/stella-maris-clock)

PHPackages © 2026

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