PHPackages                             olajoscs/dateprovider - 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. olajoscs/dateprovider

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

olajoscs/dateprovider
=====================

A simple DateTimeImmutable provider to replace or simulate the "new DateTimeImmutable"

1.0.0(5y ago)014MITPHPPHP ^7.0|^8.0

Since Feb 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/olajoscs/dateprovider)[ Packagist](https://packagist.org/packages/olajoscs/dateprovider)[ RSS](/packages/olajoscs-dateprovider/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

DateProvider
============

[](#dateprovider)

A simple library to replace `new \DateTime` or `new \DateTimImmutable` in your code.

### Why?

[](#why)

Testing is hard when you have hidden dependencies. Getting the current time is one of them, as it is always changing.

### How to use

[](#how-to-use)

Classes should depend on the `DateProvider` interface. There are 2 implementations in the library:

- `CurrentDateProvider`: returns the current date/time, just like `new \DateTimeImmutable`, your DI container should instantiate this one
- `ExactDateProvider`: returns an exact date/time, which can be used to simulate time pass, useful when writing tests.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Unknown

Total

1

Last Release

1899d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47fabfd1980b2e2628bca1a93867e391932a1a5fe59ff3131dd3b59b44b031ad?d=identicon)[olajoscs](/maintainers/olajoscs)

---

Top Contributors

[![olajoscs](https://avatars.githubusercontent.com/u/6685631?v=4)](https://github.com/olajoscs "olajoscs (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/olajoscs-dateprovider/health.svg)

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

PHPackages © 2026

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