Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changed the timezone but still getting UTC

Tags:

laravel

I have changed the timezone for my laravel app to be Africa\Cairo, and i changed this in the app.php file

|--------------------------------------------------------------------------
| 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'        => 'Africa/Cairo',

but when i check in prodduction the time zone using Carbon::now(), i get the timezone is UTC

How can i set the timezone in Carbon

like image 229
osos Avatar asked Nov 01 '22 07:11

osos


1 Answers

make sure you clear the cache, write this in your terminal (in the project directory):

php artisan config:cache

then start the project again to see the changes

like image 145
Omar Avatar answered Nov 13 '22 02:11

Omar