How to change timezone in Laravel

Any developers should modify timezone of a Laravel application depends on where their apps start business in.

In a Laravel app, there is a setting called timezone in config/app.php file. To change timezone , we need to modify its value.

The default timezone is ‘UTC’. We can change it to something like ‘Asia/Singapore’.

/*
    |--------------------------------------------------------------------------
    | 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' => 'Asia/Singapore',

You can find the list of timezone names here.

Another way to modify timezone is to use env file.

In config/app.php file

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

in .env file

APP_TIMEZONE='Asia/Singapore'

Leave a Comment

Your email address will not be published. Required fields are marked *

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close