PHP code example of mews / larbon

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

    

mews / larbon example snippets


'providers' => [
    // ...
    Mews\Larbon\LarbonServiceProvider::class,
]

'aliases' => [
    // ...
    'Larbon' => Mews\Larbon\Facades\Larbon::class,
]

Larbon::now()->format('l j F Y H:i:s');

// or

larbon()->format('l j F Y H:i:s');

$dtToronto = larbon()->createFromDate(2012, 1, 1, 'America/Toronto');
$dtVancouver = larbon()->createFromDate(2012, 1, 1, 'America/Vancouver');

echo $dtVancouver->diffInHours($dtToronto); // 3