PHP code example of tonysm / local-time-laravel

1. Go to this page and download the library: Download tonysm/local-time-laravel 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/ */

    

tonysm / local-time-laravel example snippets




use Illuminate\Support\ServiceProvider;
use Tonysm\LocalTimeLaravel\LocalTimeLaravelFacade;

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        LocalTimeLaravelFacade::useTimeFormat('H:i');
        LocalTimeLaravelFacade::useDateFormat('d/m/Y H:i');
    }
}
bash
php artisan tinker
>>> $user->created_at
=> Illuminate\Support\Carbon @1625103168 {#4106
     date: 2021-06-30 22:32:48.0 UTC (+00:00),
   }