I have made a laravel application which save data in db as UTC. My client is in South Africa and he wants the records to be displayed in South Africa timezone. Any body guide me related to this.
Thanks
I tried to convert created-at to specific timezone using Carbon while displaying record any where in system.
2
Answers
Go to
config/app.php
and then search and edit the value oftimezone
like this.And then you need to clear the config settings stored in cache.
php artisan cache:clear
php artisan config:cache
Then start the project again to see the chages.Try this.It will work.
if you are not getting proper timezone the first you need to set that time-zone into your .env file like that
TIME_ZONE="country-name/area-name"
example
TIME_ZONE="Asia/Kolkata"
After that you need to set that configuration into you config/app.php file like
‘timezone’ => env(‘TIME_ZONE’, ‘country-name/area-name’),
example
‘timezone’ => env(‘TIME_ZONE’, ‘Asia/Kolkata’),
so use like that so it will giving actual time.