project time-conversion
Convert, compare and operate with time in different units.
tm/time-conversion
Convert, compare and operate with time in different units.
- Monday, December 19, 2016
- by tommymuehle
- Repository
- 1 Watchers
- 1 Stars
- 41 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 24 % Grown
php-time-conversion
, (*1)
Convert, compare and operate with time in different unit's., (*2)
Features
Example
use TM\TimeConversion\Time;
use TM\TimeConversion\Unit;
// convert
$tenWeeks = Time::fromValue(10.0, Unit::WEEK);
$tenWeeksInDays = $tenWeeks->convert(Unit::DAY);
echo $tenWeeksInDays->getAmount(); // 70
// compare
var_dump($tenWeeks->equals($tenWeeksInDays)); // true
// subtract
echo $tenWeekInDays->subtract(Time::fromValue(10, Unit::DAY)); // 60
For more and advanced examples look into the examples directory., (*3)
Requirements
Install
composer require tm/time-conversion ^1.0
Contributing
Please refer to CONTRIBUTING.md for information on how to contribute., (*4)