Fixing TimeOffset in Grafana when using InfluxDB

Hello everyone.

I’ve been using InfluxDB for roughly two months now and I wasn’t able to figure out how to fix the time offset in Grafana when displaying data which is queried from my InfluxDB.

Setup:

  1. My InfluxDB (v1.7.8) is installed on a Windows 10 system and runs as a service.
  2. Grafana is also installed on the same Windows 10 system and runs as a service.

Background information:

InfluxDB will always convert the custom timestamps to UTC if it is running on Linux. It is using the timezoneInfo.zip which is provided by GoLang.

Solution:

Since in my case the DB runs on windows the timezoneinfo.zip can’t be used by it even if you install GoLang on the system. That’s why the displayed data seems to be in the past or the future.
Explicitly using the UTC timestamp in the write query to store  the data in the InfluxDB will fix the time offset bug. Additionally the dashboard’s timezone needs to be set to Local Browser Time.

Cya Wollitoo

Posted in Allgemein.