Download the PHP package chancegarcia/php-time-elapsed without Composer
On this page you can find all versions of the php package chancegarcia/php-time-elapsed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download chancegarcia/php-time-elapsed
More information about chancegarcia/php-time-elapsed
Files in chancegarcia/php-time-elapsed
Download chancegarcia/php-time-elapsed
More information about chancegarcia/php-time-elapsed
Files in chancegarcia/php-time-elapsed
Vendor chancegarcia
Package php-time-elapsed
Short Description Library for elapsed time using DateInterval. Figure out if x time has elapsed.
License MIT
Package php-time-elapsed
Short Description Library for elapsed time using DateInterval. Figure out if x time has elapsed.
License MIT
Please rate this library. Is it a good library?
Informations about the package php-time-elapsed
Introduction
This library is made to figure out elapsed time. Such as: "has 30 minutes elapsed so I can refresh this authentication token?"
Installation
composer require chancegarcia/php-time-elapsed
Usage
<?php
...
$start = new \DateTime("2017-01-01");
$end = clone $start;
$end->modify("+1 hour");
$diff = $start->diff($end);
$service = new TimeElapsedService($diff);
$service->hasMinutesElapsed(20); // true
$service->hasTimeElapsed(1, 'minute'); // true
$service->hasTimeElapsed(20, 'minutes'); // true
$service->hasMinutesElapsed(90) // false
$service->hasTimeElapsed(90, 'minutes'); // false
All versions of php-time-elapsed with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.0
The package chancegarcia/php-time-elapsed contains the following files
Loading the files please wait ....