PHPackages                             khandieyea/timegap - 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. khandieyea/timegap

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

khandieyea/timegap
==================

v1.0.0(12y ago)02.4k[2 issues](https://github.com/khandieyea/timegap/issues)PHPPHP &gt;=5.2.0

Since Mar 17Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

Timegap
=======

[](#timegap)

[![Build Status](https://camo.githubusercontent.com/52a30bbcc168c8ac59ad3681e6243b3ae6d037010ae20d81c70428da49b094c8/68747470733a2f2f7472617669732d63692e6f72672f6b68616e6469657965612f74696d656761702e706e67)](https://travis-ci.org/khandieyea/timegap)

Change Log

- 26/7/13 - Fixed typo in read me (thanks [@davemfletcher](https://github.com/davemfletcher))

\#WHY? Timegap as a time-passed or time-until helper that only shows relevant information. If something (such as a birthday) is 6 months away, do we really care about the seconds or minutes? I basically got sick of seeing things like:

`Your next appointment is in 1 year, 3 months, 2 weeks, 4 days, 11 hours, 21 minutes, 11 seconds`

That's pretty over exagerated, but you get the idea. Timegap is an attempt at solving this.

\#Composer

\#A usage example

Let's say your birthday is in 10 days:

```
$gap = Timegap::createThen('a datetime stamp or unix tick that is 10 days from now');

echo "Your birthday is in: ";
echo $gap->output('weeks, days, hours, minutes, seconds', 2);
```

At first, this will result in

`Your birthday is in: 1 week, 4 days`

As the gap closes say 6 days away, the 'weeks' will disappear and we will see hours

`Your birthday is in: 6 days, 4 hours`

Singular/plural words are taken care of, when your birthday is just over a day away

`Your birthday is in: 1 day, 8 hours`

As we get closer and there's less than 1 day to go, again day drops off and minutes appear

`Your birthday is in: 4 hours, 46 minutes`

And again, when under an hour to go

`Your birthday is in: 24 minutes, 11 seconds`

\#Dumb stuff you can do

```
$gap = new Timegap::createThen('a datetime stamp or tick that is 11 hours away');

echo "Your taxi will arrive in: ";
echo $gap->output('hours, minutes, seconds');
echo "That's in precisely ";
echo $gap->output('seconds');
```

Would give you something like

`Your taxi will arrive in: 10 hours, 59 minutes, 58 seconds`

`That's in precisely 39598 seconds`

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

4488d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9cdde839e302f3d7c240db0ce019c698eddb796202f6816724888b76d6bdebaa?d=identicon)[khandieyea](/maintainers/khandieyea)

---

Top Contributors

[![strongwazz](https://avatars.githubusercontent.com/u/911315?v=4)](https://github.com/strongwazz "strongwazz (48 commits)")

### Embed Badge

![Health badge](/badges/khandieyea-timegap/health.svg)

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

###  Alternatives

[doublesecretagency/craft-inventory

Take stock of your field usage.

70126.5k1](/packages/doublesecretagency-craft-inventory)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[pinoox/numera

Translate Numera

1817.3k1](/packages/pinoox-numera)

PHPackages © 2026

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