Period requires PHP 7.2.5 but the latest stable version of PHP.
Period is available on Packagist and can be installed using Composer.
$ composer require league/period
You can also use
Period without using Composer by downloading the library and:
- using any other PSR-4 compatible autoloader.
- using the bundle autoloader script as shown below:
require 'path/to/league/repo/autoload.php'; use League\Period\Datepoint; Datepoint::create('2012-05-23')->getDay()->getEndDate(); //returns DateTimeImmutable('2012-05-24 00:00:00.000000');
path/to/league/repo represents the path where the library was extracted.