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.
- My InfluxDB (v1.7.8) is installed on a Windows 10 system and runs as a service.
- Grafana is also installed on the same Windows 10 system and runs as a service.
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.
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.