I am running laravel 5.3
This is my current configuration in app.php
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'Europe/Copenhagen',
Now when executing Carbon::now(); it returns this:
Carbon {#235 ▼
+"date": "2016-12-22 14:28:09.000000" //This is an hour earlier than my current timezone
+"timezone_type": 3
+"timezone": "UTC"
}
Adding date_default_timezone_set("Europe/Copenhagen") before the Carbon call it returns this:
Carbon {#235 ▼
+"date": "2016-12-22 15:28:13.000000" //this is the correct time
+"timezone_type": 3
+"timezone": "Europe/Copenhagen"
}
I have tested the built in date(); & time(); functions, they return with the same error as Carbon. Wrong timezone.
Is this an error in my configuration or in the system? It should assume the timezone from the app.php right?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire