# Wrong Java timezone on first installation?

**URL:** <https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533>\
**Category:** Installation\
**Tags:** openhabian, timezone, openhab4\
**Created:** [June 16, 2025, 12:58pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533 "2025-06-16T12:58:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![quantheory](https://community.openhab.org/user_avatar/community.openhab.org/quantheory/32/117041_2.png) [@quantheory](https://community.openhab.org/u/quantheory)\
**Post date:** [June 16, 2025, 12:58pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/1 "2025-06-16T12:58:15Z")

</div>

- Platform information:
  - Hardware: Raspberry Pi 5
  - OS: OpenHABian 4.3.5
  - Java Runtime Environment: openjdk version “17.0.15” 2025-04-15
  - openHAB version: 4.3.5

This is not so much an ongoing issue as a gripe about something I think I just solved myself. I just set up a new OpenHABian server as a beginner, and I made sure that the timezone in `openhabian.conf` was set to my local time (America/Denver). This set `/etc/localtime` correctly, and the OpenHAB timezone and all time stamps in the web UI looked correct, but `/etc/timezone` was set to `Europe/London`, and `EXTRA_JAVA_OPTS` in `/etc/default/openhab` contained `-Duser.timezone=Europe/London`. I didn’t notice this until I tried to schedule some rules for my HVAC setup and found out that all time-of-day and `cron` triggers went off at completely the wrong times.

After finding the issue [here](https://community.openhab.org/t/oh-4-3-2-using-wrong-time-zone/162181), I figured out that I needed to fix the timezone in the above places, but I never saw anything in the documentation that says this is necessary. Normally I would file a bug report for something like this, but I honestly don’t know which of the following three possibilities is the case:

1. This is only a bug in OpenHABian for using `Europe/London` in `/etc/timezone` regardless of the `openhabian.conf` setting, and OpenHAB uses this value to set `EXTRA_JAVA_OPTS` on installation.
2. There is also a bug in OpenHAB, which for some reason sets `EXTRA_JAVA_OPTS` incorrectly on installation regardless of any other timezone setting.
3. For some obscure reason, `/etc/timezone` cannot be easily changed on first boot, and it is expected that the user will fix it, in which case there is effectively a bug in the OpenHABian _documentation_ for not mentioning that `/etc/timezone` and `EXTRA_JAVA_OPTS` need to be changed for all new installations outside of the `Europe/London` timezone.

Since I don’t know where the real issue is, I decided to just make a post here in case some developer knows what should be changed.

I should mention that it was actually _more_ confusing to see that `/etc/localtime` and the OpenHAB timezone setting were correct than if they had also been wrong! I didn’t expect `/etc/timezone` to be incorrect when `/etc/localtime` was fine (and thus `timedatectl` gave the expected output). Nor did I expect OpenHAB to be using a different timezone setting in `EXTRA_JAVA_OPTS` from the one visible in the web UI and `openhab-config` settings.

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 16, 2025, 4:26pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/2 "2025-06-16T16:26:01Z")

</div>

I think both 1 and 2 are openHABian related. I didn’t think a standard install of oh sets the java-opts for timezones at all. But there are cases where not setting the java-opts fails so I’m sure openHABian sets it just in case.

I’m wondering if there might have been a typo or something in the openhabian.conf file that prevented it from picking up that seeing. Do you happen to have any openHABian logs still from that initial install? If there was an error they should appear there.

---

<div class="post-metadata">

**Author:** ![quantheory](https://community.openhab.org/user_avatar/community.openhab.org/quantheory/32/117041_2.png) [@quantheory](https://community.openhab.org/u/quantheory)\
**Post date:** [June 16, 2025, 4:58pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/3 "2025-06-16T16:58:22Z")

</div>

I first booted openHABian a few weeks ago, and I don’t know where any logs from that process are, if I still have them. But I do have the `openhabian.conf` file itself, which contains this section, which seems fine to me:

```auto
timezone=America/Denver
locales=en_US.UTF-8
system_default_locale=en_US.UTF-8

```

I should note that the locales, as well as the hostname/username information above this section and the WiFi information below this section all seemed to work. Plus, this is the only place where I can recall giving openHABian the timezone information _at all_, and it set `/etc/localtime` correctly from this. So I don’t see how the conf file could be the issue.

(I also set the timezone in the web UI later, but I’m pretty sure that doesn’t set `/etc/localtime`; TBH I don’t know what the web UI setting _does_ affect, other than timestamps shown in the web UI itself. I noticed that it used my local time in the web UI log viewer even when events.log itself was outputting times in the other time zone, which I still find faintly baffling.)

I could see if I have the means to reproduce the issue (e.g. maybe I have a spare SD card setting around that I could stick a second copy of openHABian on, to try to reproduce with exactly the same `.conf` and hardware), but it could be a while before I have the time to do so.

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [June 16, 2025, 9:55pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/4 "2025-06-16T21:55:11Z")

</div>

Yeah the timezone stuff is a highly complex mess with many levels.  
I guess the easiest solution for you is to move over to Europe 🙂

I’ve changed the install procedure so it should now copy what you entered in `openhabian.conf` to `/etc/timezone` before proceeding.  
You can simply change `/etc/timezone` and `EXTRA_JAVA_OPTS` in `/etc/default/openhab` manually.

---

<div class="post-metadata">

**Author:** ![quantheory](https://community.openhab.org/user_avatar/community.openhab.org/quantheory/32/117041_2.png) [@quantheory](https://community.openhab.org/u/quantheory)\
**Post date:** [June 16, 2025, 11:00pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/5 "2025-06-16T23:00:17Z")

</div>

Nice, hopefully that will make things easier for other newbies.

P.S.: You may have been joking about moving to Europe, but given that I’m a scientist currently funded by the U.S. government, a move to Europe is definitely looking more likely if certain agencies’ budgets keep being cut…

---

<div class="post-metadata">

**Author:** ![mstormi](https://community.openhab.org/user_avatar/community.openhab.org/mstormi/32/55857_2.png) [@mstormi](https://community.openhab.org/u/mstormi)\
**Post date:** [June 17, 2025, 2:01pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/6 "2025-06-17T14:01:40Z")

</div>

You’re welcome!

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [June 17, 2025, 2:20pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/7 "2025-06-17T14:20:13Z")

</div>

As an aside, I know America/Denver covers a lot of area, but we are at least near neighbors. I’m in Colorado Springs and also facing a lot of the same issues you are. Good luck!

---

<div class="post-metadata">

**Author:** ![quantheory](https://community.openhab.org/user_avatar/community.openhab.org/quantheory/32/117041_2.png) [@quantheory](https://community.openhab.org/u/quantheory)\
**Post date:** [June 17, 2025, 7:25pm UTC](https://community.openhab.org/t/wrong-java-timezone-on-first-installation/164533/8 "2025-06-17T19:25:21Z")

</div>

Cool, I’m in Arvada myself, and head down to the Springs sometimes to meet up with friends. I work remotely for a lab in Washington state, though I used to work for NCAR in Boulder. Good luck with the issues you’re facing as well.
