PHP code example of manchenkov / timer

1. Go to this page and download the library: Download manchenkov/timer 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/ */

    

manchenkov / timer example snippets


use Manchenkov\Timer\Timer;

$timer = Timer::get()->hours(5)->minutes(10)->seconds(34);

$intervalValue = $timer->asNumber(); // <int> -> 18634 = 34 + (10 * 60) + (5 * 3600)

$intervalString = $timer->asString(); // <string> -> 05:10:34
// or
$intervalString = (string)$timer; // <string> -> 05:10:34