Domantas Šlaičiūnas
Domantas Šlaičiūnas

Reputation: 369

Laravel change timezone

After changing app/config/app.php FROM: 'timezone' => 'UTC', which is the default TO: 'timezone' => 'Europe/Vilnius', and still getting wrong date output. Also I changed php.ini file

[Date]
date.timezone=Europe/Vilnius

and restarted apache server, still getting wrong date output.

Any idea how to solve this?

Upvotes: 4

Views: 7575

Answers (3)

Ashima Adkyal
Ashima Adkyal

Reputation: 31

In order to reflect your timezone related changes of your config file then kindly ensure that you have cleared your cache. You can use the following command set for your reference:

php artisan cache:clear
php artisan config:cache
php artisan config:cache

Upvotes: 3

Forge Web Design
Forge Web Design

Reputation: 835

You can set your Application Time Zone by configuring app.php file in config folder. To change time zone

'timezone' => 'Europe/Vilnius'

And clear the config cache execute this command : php artisan optimize:clear

You do not have the privileges to execute that command, you can delete the cached config file.

It is located at bootstrap/cache/config.php.

Upvotes: 5

Christophe Hubert
Christophe Hubert

Reputation: 2951

Try to clear the config cache:

php artisan optimize:clear

Upvotes: 1

Related Questions