incorrect time returned in laravel

You can set your timezone in the Laravel config files. The default value is UTC.

Make sure this is set to your correct timezone.


In laravel project go to project/config there is a file app.php, in this file search for:

'timezone' => '';

pass your timezone value in it like:

'timezone' => 'Asia/Kolkata', // I am using this for India

And try again, now you will get the correct time as per your timezone.

Note: After passing the timezone value run the command php artisan config:cache to clear the cache so that you get the updated data.

Timezone list reference

Tags:

Datetime

Php