kdyby/datetime-provider-bundle
A Symfony bundle that integrates kdyby/datetime-provider, giving you DI-managed date/time services so you can inject and control the current time instead of calling new DateTime directly. This makes time-dependent code testable and lets you freeze or mock "now" in your Symfony applications...
new \DateTime() / time() inline — is a genuine architectural decision, not a library decision. This package is one (small, dated) implementation of that pattern for Symfony's DI container. As a PM, the decision it informs is "do we standardize on an injectable clock across services that make time-based decisions?"NOASSERTION means the license could not be auto-identified. For a PM this is a procurement/legal gate, not a technical detail — it blocks adoption in any org with license policy until confirmed.The v1.0.2 release ("Allow Symfony 5") is a one-line composer constraint relaxation and the first release since 2019-12-10. It is not evidence of renewed maintenance: no new capability, no PHP 8 / PSR-20 alignment, no license clarification, no dependency or security posture change. It modestly widens the set of legacy codebases that can install the package, which slightly changes the triage answer for Symfony 5 estates — and changes nothing about the recommendation. Adoption remains narrow and mostly legacy:
symfony/clock and cannot yet adopt PSR-20. Note that Symfony 5's EOL raises the cost of staying on that path, so use this only as bridge scaffolding with a dated exit.Look elsewhere — or build nothing — in most other cases:
Carbon::setTestNow() and Illuminate\Support\Carbon; there is no integration gap to fill.symfony/clock (PSR-20 ClockInterface with MockClock) is the maintained, standards-aligned replacement and should be the default recommendation.NOASSERTION licensing are abandonment and legal risks. Do not take a new dependency here — Symfony 5 compatibility is not a reason to start.DateTimeImmutable territory.Executives: This is a six-star, effectively unmaintained Symfony bundle with an unclear license. A new release landed, but it only permits Symfony 5 — a framework version that is itself end-of-life — with no new features, no security work, and no license resolution. Do not adopt it. The principle it represents — treating "current time" as an injectable dependency rather than a hardcoded global — is worth funding, because it directly reduces flaky tests and speeds up delivery of every time-based feature on the roadmap (trials, renewals, SLAs, scheduled comms). The recommendation is unchanged: standardize on symfony/clock / PSR-20 for Symfony and native Carbon test helpers for Laravel, and treat this package as a migration item if it appears in the estate. Expected cost is small; expected benefit is fewer escaped defects in billing- and deadline-adjacent flows.
Engineering: Adopt the pattern, not the package. Inject a ClockInterface (PSR-20) wherever business logic reads "now"; use MockClock in tests to pin time. If you are on Laravel, use Carbon::setTestNow() — no new dependency required. If you find kdyby/datetime-provider-bundle in a legacy Symfony codebase, log it as tech debt with a replacement path to symfony/clock, and flag the NOASSERTION license to legal before any further use. Treat v1.0.2 as a compatibility bump only — do not read it as a signal that the package is maintained, and do not use it to justify extending a Symfony 5 (EOL) lifespan.
How can I help you explore Laravel packages today?