PHPackages                             bzrk/php-timeunit - 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. bzrk/php-timeunit

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

bzrk/php-timeunit
=================

A library for better reading of time definitions

0.4(4y ago)1301MITPHPPHP &gt;= 7.4

Since Oct 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/bzrk/php-timeunit)[ Packagist](https://packagist.org/packages/bzrk/php-timeunit)[ RSS](/packages/bzrk-php-timeunit/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (1)

PHP Timeunit
============

[](#php-timeunit)

---

A library for better reading of time definitions

Examples
--------

[](#examples)

better readable code

**Plain PHP**

```
sleep(60*60*3); // 3 Hours
sleep(60*45); // 45 Minutes

$time = \time(); - (60*60*3);
```

**PHP Timeunit**

```
TimeUnit::ofHours(3)->sleep();
TimeUnit::ofMinutes(45)->sleep();

TimeUnit::now()->minus(TimeUnit::ofMinutes(3));
```

---

Type usage

**Plain PHP**

```
function a(int $seconds) {
    //whatever doing with the seconds
}

a(-123455);
a(1234);
```

**PHP Timeunit**

```
function a(TimeUnit $time) {
    //whatever doing with the seconds
}
a(TimeUnit::ofSeconds(12));
a(TimeUnit::ofSeconds(-12)); throws a InvalidArgumentException
```

Running tests
-------------

[](#running-tests)

```
composer verify
```

or

```
docker-compose up php8
docker-compose up php7
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

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 ~39 days

Total

4

Last Release

1551d ago

PHP version history (2 changes)0.1PHP &gt;= 8

0.3PHP &gt;= 7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/445ce1a0aac262330f9ea50db89f69de168758ca03040646429cd862e251dfb1?d=identicon)[bzrk](/maintainers/bzrk)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bzrk-php-timeunit/health.svg)

```
[![Health](https://phpackages.com/badges/bzrk-php-timeunit/health.svg)](https://phpackages.com/packages/bzrk-php-timeunit)
```

###  Alternatives

[askerakbar/gpt-trix-editor

GPT Trix Editor package extends the default Trix editor features in the Filament PHP framework.

458.1k](/packages/askerakbar-gpt-trix-editor)

PHPackages © 2026

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