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

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

refactoring/time
================

Facilitates working with intervals

0.2.0(11y ago)0154MITPHPPHP &gt;=5.4.0

Since Oct 31Pushed 11y ago1 watchersCompare

[ Source](https://github.com/khelonium/refactoring-time)[ Packagist](https://packagist.org/packages/refactoring/time)[ Docs](https://github.com/khelonium/refactoring-time)[ RSS](/packages/refactoring-time/feed)WikiDiscussions master Synced yesterday

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

refactoring-time
================

[](#refactoring-time)

Time Component of the refactoring.ro library. Provides conenient methods to work with Dates, especially with intervals.

Example
=======

[](#example)

$lastMonth = new LastMonth();

```
echo "First of last month was ",$lastMonth->getStart()->format("Y-m-d"),"\n";

$today = new \DateTime();

if (!($lastMonth->contains($today))) {
    echo "Today is not contained in last month \n";
}

$thisMonth = new ThisMonth();

if ($thisMonth->contains($today)) {
    echo "This month contains today\n";
}
$thisYear = new ThisYear();

if ($thisYear->overlaps($lastMonth)) {
    echo "This year overlaps with last month \n";
}
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

2

Last Release

4136d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/55331cac7396effb899dfe93253d754253b9537f7d203680334744dec73f2641?d=identicon)[khelonium](/maintainers/khelonium)

---

Tags

dateinterval

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[brick/date-time

Date and time library

3663.8M108](/packages/brick-date-time)[mpratt/relativetime

A library that calculates the time difference between two dates and returns the result in words (Example: 5 minutes ago or 5 Minutes left). The library supports other languages aswell like Spanish and German.

31120.2k2](/packages/mpratt-relativetime)[alroniks/dtms

Classes for manipulate dates and intervals with microseconds precision

187.5k](/packages/alroniks-dtms)

PHPackages © 2026

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