Change Timezone in Lumen or Laravel 5

StormTrooper picture StormTrooper · Oct 1, 2015 · Viewed 151.3k times · Source

I am using Lumen framework. How can I change Timezone to Europe/Paris CEST?

I added a varaible in my .env file:

APP_TIMEZONE=Europe/Paris

But this doesnt work. What is the right way to update timezone?

Answer

Md Rashedul Hoque Bhuiyan picture Md Rashedul Hoque Bhuiyan · Oct 1, 2015

You can set your app time zone by configuring app.php file in config folder .

To change time zone , modify the value of timezone in app.php file.

This is written in this section

|--------------------------------------------------------------------------
| 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.
|

For me i am using Asia/Dhaka as my application time zone.

Here is the appropriate syntax :

'timezone' => 'Asia/Dhaka'

list of timezones for PHP 5