brick/date-time
A powerful set of immutable PHP date-time classes built on native PHP and following ISO 8601, inspired by Java's JSR 310. Adds missing concepts such as LocalDate, LocalTime, YearMonth, and MonthDay. Requires PHP 8.2+.
LocalDate, LocalTime, YearMonth, MonthDay, YearWeek, LocalDateRange, Interval, Duration, and Period let teams represent domain rules directly—billing cycles, renewal dates, availability windows, reporting periods, trial expirations, blackout dates, leave ranges, and promotion windows—without overloading DateTime/Carbon or inventing fragile helper methods.Instant, ZonedDateTime, TimeZoneRegion, and TimeZoneOffset separate “a moment in time” from “a local calendar date.” This supports decisions around cross-region bookings, reminders, cutoffs, daylight-saving boundaries, and audit timestamps where correctness matters more than convenient formatting.LocalDateRange::intersectsWith(), getIntersectionWith()), date-range conversions, plusWeekdays()/minusWeekDays(), and period/duration objects reduce the need to hand-roll date math. This is a targeted “buy” of domain logic rather than a platform-level replacement.DefaultClock::freeze(), travelTo(), travelBy(), and scale() support QA and engineering in testing expirations, renewals, reminders, and scheduled jobs without sleeping or mocking low-level system time. This can improve confidence in roadmap items that depend on time.brick/date-time where immutable domain value objects and explicit calendar concepts reduce defects.0.x, explicitly under development, and the provided dependency signal is weak. That argues for a bounded pilot with a pinned release cycle, not an unbounded enterprise-wide mandate.0.x release cycle. The changelog shows a pattern of breaking changes between minor cycles, so version pinning and upgrade review are required.brick/date-time-doctrine package. Laravel teams using Eloquent should expect custom casts/integration work rather than a drop-in Laravel package.1.0 dependency, broad ecosystem adoption, or strict long-term semantic-versioning guarantees. This package is stable enough for production per its README, but its 0.x posture and low dependents signal are real adoption risks.Executive summary: brick/date-time is a small, MIT-licensed PHP library for correct, immutable date/time modeling. It is not a Laravel platform replacement and does not require replacing Carbon everywhere. It is most valuable in date-heavy product areas—billing cycles, scheduling, availability, renewals, reporting periods, and timezone-sensitive workflows—where ad hoc date math creates defects and slows delivery. The business case is reduced date-related bugs and clearer domain models, not a broad platform migration. Because the package is 0.x and has limited visible adoption, recommend a scoped pilot with a pinned version and clear success criteria.
Engineering summary: adopt it as a domain library alongside Laravel’s existing date handling. Use immutable value objects (LocalDate, LocalTime, YearMonth, LocalDateRange, Instant, ZonedDateTime, Duration, Period) for business rules, and use Carbon for framework-facing formatting and Eloquent timestamps. The built-in Clock abstraction improves deterministic tests for time-dependent features. Integration is standard Composer plus custom casts/adapters where needed; Doctrine users can use the companion mapping package. Main risks are the 0.x release cadence, PHP 8.2+ requirement, and lack of Laravel-native conveniences. Mitigate by pinning a release cycle, wrapping usage behind domain services or casts, and starting with one high-value module rather than a wholesale rewrite.
How can I help you explore Laravel packages today?