PHPackages                             stadly/php-date - 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. stadly/php-date

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

stadly/php-date
===============

Augmenting the built-in PHP date functionality.

v1.0.1(7y ago)15.4k—0%1MITPHPPHP &gt;=7.1

Since Dec 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Stadly/PhpDate)[ Packagist](https://packagist.org/packages/stadly/php-date)[ Docs](https://github.com/Stadly/PhpDate)[ RSS](/packages/stadly-php-date/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (1)

PhpDate
=======

[](#phpdate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/33cd3c2a6c257f9c6da077d1e260c10004e00f45d0dc66acbe56dc95dca12370/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737461646c792f7068702d646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stadly/php-date)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/3ba8c18ec64af4394fdb4a7a13bacaec6bfe77718c4d252b9b7d455b5dd4a7c3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f537461646c792f506870446174652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Stadly/PhpDate)[![Coverage Status](https://camo.githubusercontent.com/58631f0e70e6c27886503df6123f486a3315c9457ed25db83b5dc106de0ba856/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f537461646c792f506870446174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Stadly/PhpDate/code-structure)[![Quality Score](https://camo.githubusercontent.com/2e5462638a4b5d8bb905cac568f7f2d65ff307b861d760594fe69f690a4fd4e5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f537461646c792f506870446174652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Stadly/PhpDate)[![Total Downloads](https://camo.githubusercontent.com/b9849bc78a8e37108b04de180ff6f99d87c33ea997f2400a6ff033d12363f350/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737461646c792f7068702d646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stadly/php-date)

Augmenting the built-in PHP date functionality.

Install
-------

[](#install)

Via Composer

```
$ composer require stadly/php-date
```

Usage
-----

[](#usage)

```
use Stadly\Date\Interval;

Interval::compare(new \DateInterval('P1M'), new \DateInterval('P27D')); // 1
Interval::compare(new \DateInterval('P1M'), new \DateInterval('P30D')); // null
Interval::compare(new \DateInterval('P1M'), new \DateInterval('P32D')); // -1
```

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Magnar Ovedal Myrtveit](https://github.com/Stadly)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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

2

Last Release

2722d ago

### Community

Maintainers

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

---

Top Contributors

[![Stadly](https://avatars.githubusercontent.com/u/7263579?v=4)](https://github.com/Stadly "Stadly (15 commits)")

---

Tags

datedateintervaldatetimedatecarbondate-timedate-interval

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/stadly-php-date/health.svg)

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

PHPackages © 2026

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