Change Timezone in Lumen or Laravel 5

前端 未结 15 1387
逝去的感伤
逝去的感伤 2020-11-29 02:56

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/Pari         


        
15条回答
  •  春和景丽
    2020-11-29 03:51

    There are two ways to update your code. 1. Please open the file app.php file present in config directory at lool of your project. Go down the page and check Application Timezone where you will find

    'timezone' => 'UTC',
    

    Here you can add your timezone like

    'timezone' => 'Europe/Paris',
    

    If you want to manage your timezone from .env file, then you can add below code in your config.php file.

    'timezone' => env('APP_TIMEZONE', 'UTC'),
    

    and add the below line in your .env file.

    APP_TIMEZONE='Europe/Paris'
    

    Please check the link below for more information: https://laravel.com/docs/5.6/configuration#accessing-configuration-values

提交回复
热议问题