In this tutorial, we will learn how to set the default time zone to America/New_York in Laravel.
Set the default time zone to America/New_York in Laravel
The config/app.php
file in Laravel which allows you to specify the default time zone. The UTC time zone is used as the default setting.
Follow below steps to change it to the America/New_York time zone:
Step 1 - Open the config/app.php
file in your Laravel project.
Step 2 - Find the timezone
option, which should be initially set to 'UTC
'.
Step 3 - To change to New York time, select "America/New_York"
as the time zone
.
For example
'timezone' => 'America/New_York',
Your Laravel application will utilize the Eastern Time Zone (ET) for date and time calculations if the time zone is configured to 'America/New_York'
.