Installation
System Requirements
Period
requires PHP 7.2.5 but the latest stable version of PHP.
Composer
Period
is available on Packagist and can be installed using Composer.
$ composer require league/period
Going Solo
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');
where path/to/league/repo
represents the path where the library was extracted.