System applying timezone offset to local time

  • Platform information:
    • Hardware: RaspberryPi 3
    • OS: Raspbian 10
    • openHAB version: 3.1.0


I am having a problem where the UI is applying my local time zone offset to the local time instead of UTC. My UI and system time zones are both set to the correct values (US/Eastern), but there seems like there must be a mismatch somewhere. The screenshots below were both taken when the local time was 21:46 but you can see the UI is trying to offset that time by -5 hours.

Thank you for your help.

openhabian@openhabian:~ $ timedatectl status
               Local time: Mon 2021-12-06 21:46:22 EST
           Universal time: Tue 2021-12-07 02:46:22 UTC
                 RTC time: n/a
                Time zone: US/Eastern (EST, -0500)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

The -0500 IS the offset from UTC, which gives the local time as displayed. Add 5 hours to the time and you get UTC.

1 Like

That makes sense, thank you. However, I am having a problem with time-triggered rules firing at the wrong time. I assumed the timezone was the problem but it must be a separate issue.

The scheduler underlying openHAB uses Java time. This can be set differently that both host operating system zone and openHAB zone.
Check your openhab.log as this timestamps log entries using the Java clock.

Having to set it in three different places is very confusing, but the JRE time zone seems to be what my problem was. Many thanks.