I recently moved my openHAB installation from a Raspberry Pi to a Docker installation running on my new Synology Diskstation. The whole process worked basically flawless until I noticed that some (time-dependent!) rules would not fire. Or rather - fire an hour late.
Looking in the the log files I realized that the timestamps in there were off by an hour.
... 2020-01-05 19:12:19.439 [INFO ] [pse.smarthome.model.script.pir.rules] - ... 2020-01-05 19:12:29.683 [INFO ] [pse.smarthome.model.script.pir.rules] - ... 2020-01-05 19:16:02.959 [INFO ] [pse.smarthome.model.script.pir.rules] - ... ...
However, the system time on the Synology Diskstation was correct, so this was obviously an issue with the openHAB Docker container.
The solution I came up with wa setting the timezone using the
EXTRA_JAVA_OPTS environment variable like this:
Stop the container
Editthe container, find the
Advanced Settingsand add this entry.
Valid settings for the timezone value can be found here.
Start the container again.
Done, time is correct now.