DateTime format stateDescription always -1 hour

Hi,
I use the following pattern to display the state of my datetimes via a stateDescription:

%1$td.%1$tm.%1$tY %1$tH:%1$tM

The result is always 1 hour to early. As an example:
21.12.2021 14:30 instead of
21.12.2021 15:30

My locale is set like this:

What can be the reason that the conversion change the hour?

DateTime formatter always formats and converts to local time in the GUI.

So there’s two ways for it to go wrong -

The “raw” Item datetime state does include timezone info, and your example is non-local; default UTC perhaps.

Further, I think the formatter uses Java locale. This can be set to a different timezone than openHAB.

@rossko57 Thank you so much for helping me out again.

The solution here which you linked worked for me on Synology NAS DS716+ with docker:

My configuration:

Thanks a lot!

We seem to get a lot of these queries. I wonder if Docker installs skip setting up Java with appropriate locale. Does this need adding to some instructions, or something?

I found out at my notes that on the update from openhab 2 to 3 I did add this variable:

But I lost this configuration as I created a new container last month to go from 3.2.0.M5 to 3.2.0 where I didn’t copy all my configurations.

For the general problem. Maybe someone can add these setting of the timezone locale to the standard openhab docker container? On my last install the setting was just empty by default.

1 Like