1. Go to this page and download the library: Download gamez/duration library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gamez / duration example snippets
use Gamez\Duration;
$duration = Duration::make('13 minutes 37 seconds');
// or start with nothing
$duration = Duration::none();
use Gamez\Duration;
Duration::make('PT13M37S');
Duration::make(new DateInterval('PT13M37S'));
use Gamez\Duration;
Duration::make('13:37'); // minutes:seconds
Duration::make('13:37:37'); // hours:minutes:seconds
use Gamez\Duration;
Duration::make('13 minutes 37 seconds');
use Gamez\Duration;
$duration = Duration::make('8 days 29 hours 77 minutes');
echo (string) $duration; // P9DT6H17M
echo json_encode($duration); // "P9DT6H17M"