fix: respect TZ env var as fallback for timezone config#2753
Merged
alexjustesen merged 2 commits intoApr 19, 2026
Conversation
Add TZ as a fallback in the env chain for both timezone and display_timezone so that the standard Docker TZ variable is respected when APP_TIMEZONE / DISPLAY_TIMEZONE are not set.
alexjustesen
requested changes
Apr 19, 2026
Addresses review feedback from @alexjustesen — easier to read.
alexjustesen
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
TZas a fallback in the env chain for bothtimezoneanddisplay_timezoneinconfig/app.php, so the standard DockerTZvariable is respected whenAPP_TIMEZONE/DISPLAY_TIMEZONEare not set.The problem
Docker users typically set timezone via
TZ=Europe/Londonin their compose file. Currently, both config values fall back directly to'UTC', ignoringTZentirely. This causes times to display in UTC even when the container's system clock is correct.This has been reported in #939, #1503, #805, #1739, and #1214 — all closed with "set
APP_TIMEZONEandDISPLAY_TIMEZONE" as the workaround.The fix
Resolution order:
APP_TIMEZONE→TZ→UTCNon-breaking — existing deployments with
APP_TIMEZONEorDISPLAY_TIMEZONEare unaffected.