PHPackages                             mic2100/fuzzy-time - 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. mic2100/fuzzy-time

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

mic2100/fuzzy-time
==================

A fuzzy time calculator

7.4.0(4y ago)017MITPHPPHP &gt;=7.4

Since Apr 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mic2100/fuzzy-time)[ Packagist](https://packagist.org/packages/mic2100/fuzzy-time)[ Docs](http://github.com/mic2100/fuzzy-time)[ RSS](/packages/mic2100-fuzzy-time/feed)WikiDiscussions master Synced 2mo ago

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

Fuzzy Time
==========

[](#fuzzy-time)

This was inspired from the fuzzy time clock that exists on Ubuntu. It gives you a rough idea what the time is without you knowing the exact minutes.

i.e. quarter past nine or half past two

### Installation

[](#installation)

`composer require mic2100/fuzzy-time`

### Usage

[](#usage)

```
use Mic2100\FuzzyTime\GeneratorAwareTrait;
use Mic2100\FuzzyTime\GeneratorFactory;
use Mic2100\FuzzyTime\Language\Dictionaries\English;
use Mic2100\FuzzyTime\Language\Dictionaries\German;
use Mic2100\FuzzyTime\Language\LanguageFactory;

date_default_timezone_set('Europe/London');

$factory = new GeneratorFactory();
$english = $factory->get(); //or $factory->get(LanguageFactory::get(English::HANDLE);
$german = $factory->get(LanguageFactory::get(German::HANDLE));

class SampleClass
{
    use GeneratorAwareTrait;
}

$traitClass = new SampleClass();

while (true) {
    echo $english->getFuzzyTime() . PHP_EOL;
    echo $german->getFuzzyTime() . PHP_EOL;
    echo $traitClass->getFuzzyTime((new DateTime('-25 MINS'))) . PHP_EOL;
    sleep(30);
}

/*----------------------------------------------
 * Example Output
 *
 * five to one //$english->getFuzzyTime()
 * fünf vor ein //$german->getFuzzyTime()
 * half to twelve //$traitClass->getFuzzyTime((new DateTime('-25 MINS')), LanguageFactory::get(English::HANDLE))
 *
 * or
 *
 * three o'clock //$english->getFuzzyTime()
 * drei uhr //$german->getFuzzyTime()
 * twenty five to three //$traitClass->getFuzzyTime((new DateTime('-25 MINS')), LanguageFactory::get(English::HANDLE))
 */

```

The `LanguageFactory` **DOES NOT** have to be used if you only want to use English because this is the default language

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

1499d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd22019623ac7e0ed3b0680eb602a6794fbbd4467ba905fa3ab07bfc962069ce?d=identicon)[mic2100](/maintainers/mic2100)

---

Top Contributors

[![mic2100](https://avatars.githubusercontent.com/u/2852547?v=4)](https://github.com/mic2100 "mic2100 (18 commits)")

---

Tags

time

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mic2100-fuzzy-time/health.svg)

```
[![Health](https://phpackages.com/badges/mic2100-fuzzy-time/health.svg)](https://phpackages.com/packages/mic2100-fuzzy-time)
```

###  Alternatives

[symfony/clock

Decouples applications from the system clock

430168.9M205](/packages/symfony-clock)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6308.9M39](/packages/knplabs-knp-time-bundle)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)[brick/date-time

Date and time library

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

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)

PHPackages © 2026

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