Did you clear your config cache?
artisan config:clear
Edit:
Most store UTC and display local time for the user. You have to make a column to store the users timezone.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a timezone issue when saving an item in created_at, it uses the UTC date, while I have set Europe/Rome.
To begin with, I did these debug steps:
select now(); returns the correct date: 2024-06-01 17:44:18 $now = Carbon::now();
echo $now;
Using:
$currentTimezone = date_default_timezone_get();
echo $currentTimezone;
It prints "UTC".
The server's datetime is correct. If I create a PHP file (without using Laravel) with
$currentTimezone = date_default_timezone_get();
echo $currentTimezone;
The timezone is correct...
In Laravel, I have:
app.php
'timezone' => env('APP_TIMEZONE', 'Europe/Rome'),
.env
APP_TIMEZONE='Europe/Rome'
After making the change, I use php artisan config:clear. How can I fix this timezone issue?
Please or to participate in this conversation.