From 357c0e18140c13d9c732112cb66854e7ff4cbc28 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 11 Feb 2025 23:15:26 -0600 Subject: [PATCH] remove `APP_TIMEZONE` environment variable force the timezone to be defined in the config file, rather than deferring to an environment variable. IMO having the timezone dependent on an environment variable adds an unnecessary amount of risk for your average user who may be unaware of the effects from changing this value. some scenarios where this could cause issues: - devs set this value to their local timezone on their local dev machines, and they are writing `Carbon:create()` commands or similar that now are working only under the assumption of that timezone value - you have multiple production servers setup across the country and each has their own timezone value according to their location, but they all talk to a central database. now the database is loaded with mixed timezone variables having an explicit value defined once for the application removes these risks. reverts part of #6188 --- .env.example | 1 - config/app.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.env.example b/.env.example index 6fb3de6526c..93561a48d29 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,6 @@ APP_NAME=Laravel APP_ENV=local APP_KEY= APP_DEBUG=true -APP_TIMEZONE=UTC APP_URL=http://localhost APP_LOCALE=en diff --git a/config/app.php b/config/app.php index f46726731e4..324b513a273 100644 --- a/config/app.php +++ b/config/app.php @@ -65,7 +65,7 @@ | */ - 'timezone' => env('APP_TIMEZONE', 'UTC'), + 'timezone' => 'UTC', /* |--------------------------------------------------------------------------