Skip to content

Fix time zone detection issues#487

Merged
wborn merged 4 commits intoopenhab:mainfrom
wborn:fix-time-zone-issues
Feb 24, 2026
Merged

Fix time zone detection issues#487
wborn merged 4 commits intoopenhab:mainfrom
wborn:fix-time-zone-issues

Conversation

@wborn
Copy link
Copy Markdown
Member

@wborn wborn commented Feb 23, 2026

Since OpenJDK 21.0.10 /etc/timezone is no longer used to detect the default JVM time zone (JDK-8345213).

  • Update /etc/localtime symlink based on TZ environment variable
  • Install missing tzdata package in Alpine image
  • Update documentation

Fixes #485

Since OpenJDK 21.0.10 /etc/timezone is no longer used to detect the default JVM time zone (JDK-8345213).

* Update /etc/localtime symlink based on TZ environment variable
* Install missing tzdata package in Alpine image
* Update documentation

Fixes openhab#485

Signed-off-by: Wouter Born <[email protected]>
@wborn wborn requested a review from a team as a code owner February 23, 2026 19:30
Signed-off-by: Wouter Born <[email protected]>
@wborn wborn force-pushed the fix-time-zone-issues branch from 11b384c to 186949b Compare February 23, 2026 19:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes timezone detection issues that arose from changes in OpenJDK 21.0.10, which no longer uses /etc/timezone to detect the default JVM timezone. The fix implements a more robust approach using the TZ environment variable and dynamic symlink creation at container startup.

Changes:

  • Added TZ environment variable (default: Etc/UTC) to both Alpine and Debian Dockerfiles
  • Updated entrypoint scripts to create /etc/localtime symlink based on TZ at runtime
  • Installed tzdata package in Alpine image and configured default timezone symlink during build
  • Updated documentation to replace volume mount approach with TZ environment variable usage

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
debian/Dockerfile Added TZ environment variable with default value "Etc/UTC"
debian/entrypoint Added timezone configuration by creating symlink from TZ to /etc/localtime
alpine/Dockerfile Added TZ environment variable and tzdata package installation, with build-time symlink creation
alpine/entrypoint Added timezone configuration by creating symlink from TZ to /etc/localtime
README.md Removed volume mount examples for /etc/localtime and /etc/timezone, replaced with TZ environment variable usage across all examples, added new timezone configuration documentation section, and corrected Ansible YAML syntax

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread alpine/entrypoint Outdated
Comment thread debian/entrypoint
Comment thread alpine/entrypoint Outdated
Comment thread alpine/Dockerfile Outdated
Comment thread debian/entrypoint Outdated
Signed-off-by: Wouter Born <[email protected]>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread alpine/entrypoint
Comment thread debian/entrypoint
@wborn wborn merged commit b08f918 into openhab:main Feb 24, 2026
11 checks passed
@wborn wborn deleted the fix-time-zone-issues branch February 24, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UTC used instead of local timezone with ARM64 Docker image for openHAB 5.1.2

2 participants