dev-master
9999999-dev https://github.com/kamilkrzywda/php-date-intervalProvides additional functionality to the DateInterval class.
MIT
The Requires
- php >=5.3
- ext-bcmath *
The Development Requires
date time interval
Wallogit.com
2017 © Pedro Peláez
Provides additional functionality to the DateInterval class.
Provides additional functionality to the DateInterval class., (*2)
The DateInterval class builds on the existing DateInterval class provided by PHP. With the new class, you may, (*3)
DateInterval to the interval spec
DateInterval to the number of seconds
DateInterval from the number of secondsThe conversion to seconds requires a bit of explaining., (*4)
Add it to your list of Composer dependencies:, (*5)
$ composer require kamilkrzywda/date-interval=1.*
<?php
use Herrera\DateInterval\DateInterval;
$interval = new DateInteval('P2H');
echo $interval->toSeconds(); // "7200"
echo DateInterval::toSeconds($interval); // "7200"
echo $interval->toSpec(); // "P2H"
echo DateInterval::toSpec($interval); // "P2H"
Provides additional functionality to the DateInterval class.
MIT
date time interval