8000 [11.x] remove `APP_TIMEZONE` environment variable by browner12 · Pull Request #6536 · laravel/laravel · GitHub
[go: up one dir, main page]

Skip to content

[11.x] remove APP_TIMEZONE environment variable #6536

New issue
< 8000 div class="px-4">

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
browner12 committed Feb 12, 2025
commit 357c0e18140c13d9c732112cb66854e7ff4cbc28
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
|
*/

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

/*
|--------------------------------------------------------------------------
Expand Down
0