Description
Period is an open source PHP library from The PHP League that provides a time range class built as an immutable value object. It is based on ideas from Mathias Verraes' article Resolving Feature Envy in the Domain and extends them to cover the basic operations you need with time ranges. Named constructors make it quick to create intervals; for example, Period::around builds a one-hour range around a date in one call instead of several DateTime and DateInterval steps. You can iterate over dates inside an interval, split it into smaller periods, compare intervals and datepoints, modify ranges, format them, find the gaps between intervals and even display intervals as a Gantt chart. It installs with Composer as league/period. When a new major version ships, the previous stable release keeps getting patches and security fixes for six months.…
Highlights
- Immutable time range value objects for PHP
- Named constructors for intervals, datepoints and durations
- Iterate over or split intervals
- Compare, modify and format ranges
- Find gaps and render Gantt charts
- Composer install as league/period
Ratings & Reviews
No ratings yet
Be the first to rate Period.
People also visit
crontab.guru
Translate any cron schedule expression into plain English as you type
Period FAQ
What is Period?
PHP's time range class: a library with immutable value objects that cover basic operations on time ranges.
How do I install it?
Run composer require league/period.
What can it do with intervals?
Create them with named constructors, iterate over dates, split them, compare and modify them, format them, find gaps and display them as a Gantt chart.
How long are old versions supported?
After a new major version, the previous stable release gets patches and security fixes for six more months.
What are the best Period alternatives?
Popular alternatives to Period include crontab.guru, Pricore and PHPAlgorithms. See all Period alternatives







