How to change timezone using date() and strtotime() in Laravel

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/Kuala_Lumpur as my application time zone.

Here is the appropriate syntax :

'timezone' => 'Asia/Kuala_Lumpur'

list of timezones for PHP

NOTE : run php artisan config:clear to effect this changes

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top