PHPackages                             johncorrelli/php-daydifference - 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. johncorrelli/php-daydifference

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

johncorrelli/php-daydifference
==============================

Finds the number of days between two dates, with exclusions, such as day of the week and/or holidays.

v1.1(1y ago)037.7k↑45.8%1[1 PRs](https://github.com/johncorrelli/php-daydifference/pulls)PHPPHP &gt;=7.4

Since Aug 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/johncorrelli/php-daydifference)[ Packagist](https://packagist.org/packages/johncorrelli/php-daydifference)[ RSS](/packages/johncorrelli-php-daydifference/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (9)Used By (0)

php-daydifference
=================

[](#php-daydifference)

A simple php tool to help you calculate the number of days between two given dates, while also giving you the ability to factor in excluded dates.

Excluded dates can be:

- a day of the week (ie: Weekends)
- a specific date (ie: 2022-12-25)
- a repeating date (ie: \*-01-01)

Example usage
-------------

[](#example-usage)

A simple use case of this would be to determine how many work days there are for a given date range.

```
$startDate = new DateTime('2022-01-01');
$endDate = new DateTime('2022-02-01');
$workDays = [1, 2, 3, 4, 5]; // 0 = sunday, 1 = monday, etc.
$holidays = [
  '*-01-01',
  '2022-01-03',
];

$init = new DayDifference($startDate, $endDate, $workDays, $holidays);
$dayDifference = $init->difference();
```

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

[](#contributing)

This package doesn't get much activity so I don't have CI setup for this. Please ensure all commits pass:

- `composer standards`
- `composer static`
- `composer test`

You can run `composer standards:fix` to automatically adhere the code to the standard.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~357 days

Recently: every ~226 days

Total

7

Last Release

676d ago

Major Versions

v0.0.1 → v1.0.02020-10-12

PHP version history (3 changes)v0.0.1PHP ^5.3.3 || ^7.0

v1.0.0PHP ^7.4

v1.0.1PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/59413656492e3afbb7bb42fa9a5bc7ebce978a48da7ac2e5a8cf7e7f6ef6b5c2?d=identicon)[johncorrelli](/maintainers/johncorrelli)

---

Top Contributors

[![johncorrelli](https://avatars.githubusercontent.com/u/18272064?v=4)](https://github.com/johncorrelli "johncorrelli (17 commits)")[![gitwilliam](https://avatars.githubusercontent.com/u/1936859?v=4)](https://github.com/gitwilliam "gitwilliam (1 commits)")[![jcalebj](https://avatars.githubusercontent.com/u/5686190?v=4)](https://github.com/jcalebj "jcalebj (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/johncorrelli-php-daydifference/health.svg)

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

###  Alternatives

[humanmade/hm-rewrite

HM\_Rewrite is a wrapper for the WordPress WP Rewrite system. http://hmn.md/wordpress-rewrite-rules-hm-core-style/

16115.9k](/packages/humanmade-hm-rewrite)

PHPackages © 2026

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