PHP code example of brekitomasson / seconds

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

    

brekitomasson / seconds example snippets


Seconds::minutes(1);
// 60

Seconds::minutes(32);
// 1920

Seconds::hours(3);
// 180

Seconds::days(3)
// 259200

Secnds::weeks(4)
// 2419200

Seconds::minutes(-1);
// 60

Seconds::hours(3) + Seconds::minutes(30);
// 12600

use Breki\Seconds;Seconds::weeks(13);
// 7862400

Seconds::days(31 + 30 + 31);
// 7948800

$date1 = Carbon::parse('2023-09-23 07:14:00 UTC')
$date2 = Carbon::parse('2023-12-31 23:59:59 UTC')

$date1->diffInSeconds($date2)
> 8613959