I’ve dug around in the forum for other mentions of this and while there are a few similar posts, none of the suggested fixes seem to work for me.
The problem: I’m in Ireland. During daylight savings time, the timezone gets rendered as IST (“Irish Summer Time”). Unfortunately, most date-parsing systems don’t recognise that as Irish Summer Time, they recognise it as Indian Summer Time, which is at a 5 1/2 hour offset from UTC, or a 4 1/2 hour offset from me. 4 1/2 hours neatly corresponds to the the problem I’m seeing.
- Platform is MacOS High Sierra 10.13.6 (17G14019), Correto Java 1.8, OpenHAB 2.5.0 release build, persistence via MySQL 5.7.16
- System time is Europe/Dublin, currently “Irish Summer Time”, UTC + 1
- Database time is system time, so that’s also UTC + 1
- mysql.cfg has “localtime=false”; localtime=true doesn’t fix the problem (and may have made it worse by persisting the Indian time instead of the Irish time)
- OpenHAB persistence timestamps in log messages are correct
- I’ve accidentally persisted my NTP item, so I can check that the values being stored in the database are correct (i.e. ItemNN.Time ~= ItemNN.Value)
- when I ask mysql - via the command line - for the most recent update to an item, it gives me the correct time, e.g. 2020-08-08 09:50:46
- when I ask the REST UI for the same information, it gives me 2020-08-08 05:20:46 2020 - 04:30 ahead of what it should be, i.e. it’s taking the database time as IST and re-rendering it to localtime.
This principally affects charting. Oddly, up until a couple of months ago I was running this stack on an older Mac (and an older MacOS) with Oracle’s Java instead of Corretto, and this problem didn’t show up. I’ve also tried using OpenJDK. So it’s entirely possible this is a combination of my specific timezone and my choice of JDK.
Any advice on fixing this welcome. It’s marginally annoying right now, because the only thing it really impacts are charts that I don’t particularly use, but the breakage on the REST API means I can’t really use this for anything without hacking on it.