Augmenting the built-in PHP date functionality.
Via Composer
$ composer require stadly/php-date
use Stadly\Date\Interval;
Interval::compare(new \DateInterval('P1M'), new \DateInterval('P27D')); // 1
Interval::compare(new \DateInterval('P1M'), new \DateInterval('P30D')); // null
Interval::compare(new \DateInterval('P1M'), new \DateInterval('P32D')); // -1
Please see CHANGELOG for more information on what has changed recently.
$ composer test
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
If you discover any security related issues, please email magnar@myrtveit.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.