PHP code example of ferencbalogh / timy
1. Go to this page and download the library: Download ferencbalogh/timy 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/ */
ferencbalogh / timy example snippets
"php": ">=8.0"
use FerencBalogh\Timy\DurationFormatter;
$formatter = new DurationFormatter();
echo $formatter->format(0); // Output: "now"
echo $formatter->format(120); // Output: "2 minutes"