PHPackages                             ferencbalogh/timy - 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. ferencbalogh/timy

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

ferencbalogh/timy
=================

src formats a duration given in seconds into a human-friendly format.

1.0.3(1y ago)03MITPHPPHP ^8.0

Since Apr 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ferencbalogh/timy)[ Packagist](https://packagist.org/packages/ferencbalogh/timy)[ RSS](/packages/ferencbalogh-timy/feed)WikiDiscussions master Synced today

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

⏱️ Timy Duration Formatter
==========================

[](#️-timy-duration-formatter)

A framework-agnostic PHP library that provides a solution to the Codewars 'Human Readable Duration Format' kata by converting a duration given in seconds into a human-readable format (e.g., '1 hour, 1 minute and 2 seconds').

### Rules

[](#rules)

✅ Clean code principles
✅ Liskov Substitution Principle
✅ Works with any framework (Laravel, Symfony, etc.)
✅ Unit tested

### Requirements

[](#requirements)

```
"php": ">=8.0"

```

### Test results

[](#test-results)

✅ Now for zero seconds
✅ One second
✅ One minute and two seconds
✅ One minute
✅ Two minutes
✅ Fifty nine minutes and fifty nine seconds
✅ One hour
✅ One hour one minute and two seconds
✅ Two hours
✅ One day
✅ One day one hour and one second
✅ Two days
✅ One year
✅ One year and two seconds
✅ Two years
✅ One year one day one hour one minute and one second
✅ Hundred eighty two days one hour forty four minutes and forty seconds
✅ Four years sixty eight days three hours and four minutes

OK (18 tests, 18 assertions)

### Install

[](#install)

```
composer require ferencbalogh/timy

```

### Usage

[](#usage)

```
use FerencBalogh\Timy\DurationFormatter;

$formatter = new DurationFormatter();

echo $formatter->format(0); // Output: "now"
echo $formatter->format(120); // Output: "2 minutes"

```

### Usage in laravel

[](#usage-in-laravel)

```
use FerencBalogh\Timy\DurationFormatter;

Route::get('/timy',  function () {
    $duration = new DurationFormatter();
    return $duration->format(111);
});

```

### Notes:

[](#notes)

This package is open-sourced software licensed under the MIT license

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance44

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Total

3

Last Release

435d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/259f0c180c6c514c29ecf5359f2545db183f3818cb55a9ef62a6b03bbcf41c0c?d=identicon)[trisztan](/maintainers/trisztan)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ferencbalogh-timy/health.svg)

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

###  Alternatives

[worksome/feature-flags

A package to manage feature flags in your application

11536.2k](/packages/worksome-feature-flags)

PHPackages © 2026

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