OpenHAB Time off after daylight savings time

I’ve searched and saw a few daylight savings related issues, but I don’t think any of those are the same issue as they related to specific bindings.

I run openHAB in Docker. Version openhab/openhab:2.2.0-amd64-debian.

My issue is that openHAB is one hour off after the most recent daylight savings time. This causes timed events to happen an hour later than they should. When I log into the console on the server and check the date/time, it is correct. For example:

Tue Mar 27 08:07:48 PDT 2018

However, the openHAB log shows times that don’t factor for the hour change (start of a log line):

2018-03-27 07:07:50.172

This is the command used to start openHAB within a service:

ExecStart=/usr/bin/docker run --name %n
-m 1024M
-v /etc/localtime:/etc/localtime:ro
-v /etc/timezone:/etc/timezone:ro
-v /opt/openhab/conf:/openhab/conf
-v /opt/openhab/userdata:/openhab/userdata
-v /opt/openhab/addons:/openhab/addons
-v /opt/openhab/.java:/openhab/.java

I have verified that the timezone is correct. I am in Oregon.

$ ls -l /etc/localtime /etc/timezone
lrwxrwxrwx 1 root root 39 Nov 7 05:06 /etc/localtime -> /usr/share/zoneinfo/America/Los_Angeles
lrwxrwxrwx 1 root root 39 Mar 16 06:28 /etc/timezone -> /usr/share/zoneinfo/America/Los_Angeles

The docker container doesn’t seem to be respecting the timezone or localtime. I’ve also seen in paperUI that Configuration->System->Regional Settings has a “Time Zone” option. I change that and save and it shows in the log, but it doesn’t seem to change what time openHAB thinks it is, even if I restart the service.

2018-03-27 07:14:44.752 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to en_US, Location set to null, Time zone set to America/Los_Angeles

Has anybody else run into this? What can I do to fix it?

  • Platform information:
    • Hardware: Intel Core 2 Duo
    • OS: Fedora 25 with Docker
    • openHAB version: openhab/openhab:2.2.0-amd64-debian

Only a “you are not alone” message - I still have OH1 running on a Windows platform. Windows and OH appear to agree on what the new time was, but OH timer tasks are pretty messed up. Whole system reboot and all is well.

Not going to worry about it for OH1 myself. I did wonder how cleanly Java manages this stuff, although the root cause may well be in assumptions in my rules.

I think you may need to configure NTP binding to get OH to follow time changes.

Thanks for sharing your experience. I previously rebooted the server when debugging this issue and it did not fix anything. I’ll look into the NTP binding.

I wonder if somewhere in the userdata directory there’s a setting that’s stored saying to ignore DST or something. I just tried changing the time to New York, which should be 3 hours later than the time here.The logs did show 3 hours later than the incorrect time, which is 2 hours later than the accurate time. I could fix this by setting a timezone that currently has my correct time, but I want to fix it once and forget it rather than having to make a change every time we gain or lose an hour.

Unfortunately I am in the same boat as you and cannot figure this out. It throws off every rule I have right now that utilizes the cron feature. The log is an hour behind, as well as the cron but the system time on the computer is correct. Just wish I knew where it was pulling the information from.

Thanks for your response. I ended up just setting the time zone one hour off of mine so that it shows the correct time. I’ll just need to remember to reset my openhab clock every time daylight savings happens :slight_smile: