I’m Runnng OH 3.0.0 M2 on a Ubuntu server. The time on the Ubuntu server shows the correct time…
Installed the NTP binding which is ONLINE and defined a Item “Date” in the items file.
If you see in the event.log the timestamp runs 1 hour behind the ntp time which is the correct time.
Also if i show this date in the MainUI the time runs 1 hour behind?
Thanks for this. I just installed OH3 and had the same issue. In openhabian you can change the time zone in the openhabian-config settings, but I would have expected it to pick the time zone up when you set it in the MainUI setup wizard.
So I have the same issue with my new Openhab3 install on debian. The system all looks correct:
admin@openhab3:/$ timedatectl
Local time: Wed 2021-01-06 19:12:18 AEDT
Universal time: Wed 2021-01-06 08:12:18 UTC
RTC time: n/a
Time zone: Australia/Sydney (AEDT, +1100)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
but my openhab logs and rules are an hour behind. When I check the karaf console I see it’s behind there and it looks to be due to:
String user.timezone GMT+10:00
Sydney is currently on daylight savings so it’s GMT+11. I think it got this value from the Regional → Time Zone setting in the GUI and I would say the bug is that is should not be setting GMT+10 but Australia/Sydney so it will change with DST, but now I tried to set the Time Zone to nothing (gui says it will use underlying machine timezone) and even to another zone (that is GMT+11 so at least my stuff will be on time for now) but even with a bounce and a cleared cache I cannot change this value or see where it is set in the configs.
I know I can implement the EXTRA_JAVA_OPTS but that surely can’t be the answer here as it potentially means getting users to dick around on the backend. Is this affecting others? (possibly only those in the Southern hemisphere??)
I’m not a developer, but from a user perspective I think this amounts to, “setting the time zone in Main UI (either by setup wizard or in Region Settings) does not change system time.”
For clarity, I did a fresh openHABian install and specified my time zone in the setup wizard. That was properly reflected in the Region Settings, but my system time didn’t change until I used openhabian-config.
As you say, though, I wonder why others haven’t come across this issue, unless it’s specific to the current stable release.
Strange behaviour…
I’m sure that when i set the timezone in the OH setup wizard and restarted the application the time was not corrected. Only after setting the EXTRA_JAVA_OPTS the time was corrected!
Indeed this is not the correct way to do this! It should work via the OH setup…
Don’t know how to report this as a bug but feel free to do so!
Just an update, I discovered that when /etc/timezone is a flat file with Australia/Sydney in it, Karaf reads it fine, but when it is a softlink to /usr/share/zoneinfo/Australia/Sydney, Karaf shows UTC+10.
During my troubleshooting I think I used timedatectl to set my timezone to the same zone it already was (Australia/Sydney) and that set the flat file which is why it suddenly started working.
This is probably a bug in apache karaf not openhab, although the question still remains why the value set in Openhab Gui (currently Asia/Magadan) does not get picked up by karaf.