1. Go to this page and download the library: Download elephant-php/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/ */
elephant-php / duration example snippets
use ElephantPhp\Duration\Duration;
$start = new DateTimeImmutable('2026-01-01 10:00:00');
$end = new DateTimeImmutable('2026-01-01 11:01:01');
$duration = Duration::between($start, $end);