Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel changing timezone not reflecting the correct time

I am changing the timezone into Asia/Singapore at config/app.php, but when I try to do a date("Y-m-d H:i:s"); the result is still in UTC.

Is there anything in Laravel that overrides that timezone that I set at config/app.php ?

like image 825
PinoyStackOverflower Avatar asked Sep 26 '17 10:09

PinoyStackOverflower


2 Answers

Just do this:

'timezone' => 'Asia/Singapore'

in config/app.php file and run this 3 command:

php artisan cache:clear

php artisan view:clear and

php artisan config:cache

Hope this helps you!!

like image 74
Hiren Gohel Avatar answered Sep 30 '22 16:09

Hiren Gohel


Add this in config/app.php file:

'timezone' => 'Asia/Singapore'  

After, run this command:

 php artisan config:cache
like image 41
Arzoo Avatar answered Sep 30 '22 14:09

Arzoo