How to tell OH3 to store timestamps in UTC?

  • Platform information:
    • Hardware: Ryzen 5/32GB/1 TB
    • OS: Ubuntu 21.10
    • Java Runtime Environment: openjdk 11.0.13 2021-10-19
    • openHAB version: openHAB 3.2.0

I have a device which is repoirting MQTT messages to OH via a MQTT broker, and I have JDBC persistence setup to store the values in my Mariadb that is running on my NAS. The issue is that when I graph the data using Grafana, the data is always shifted by my offset from UTC (-5 hrs right now, EST).

My research on this forum shows that the issue is related to how the data timestamp is stored in the database. If the data is stored without any timezone information, then UTC is presumed, and thus the data is shifted to the local timezone. So it looks like data taken one second ago was waken 5 hours ago.

The solution, according to other posts on this forum, is to make sure OH writes timestamps to the db using UTC, and to use the DATETIME datatype for the timestamp field. the database reports that the datatype is DATETIME, and even if I switch it to TIMESTAMP, it appears to have no impact at all. Sounds great. But I cannot find how to control the way OH writes timestamps . My OH instance is set to my local timezone. My MariaDB is set to my local timezone. My ubuntu system which is hosting OH, the MQTT broker, and grafana are all set to my local timezone. I see no other settings related to timezone. How do I implement the prescribed fix?

image

image