Time zone - Influx spread wrong time frame

I am using InfluxDB 1.7 and Grafana 8.4.6 hosted in the cloud.

All the line charts uses my browsers time (UCT+2).

The problem is now I do a query that shows the spread for the last day, now it calculates it on UCT and not on UCT+2, wrong time frame.

Can you adjust the time filter somehow? Well that is what I think needs to be adjusted to fix the query.

SELECT (spread(pulseNO)*0.3) FROM misol_weather  WHERE $timeFilter GROUP BY time(1d) fill(none)


Because your InfluxDB groups per UTC calendar day by default. InfluxDB returns 2022-09-18 00:00:00 timestamp for 2022-09-18 data. Grafana in your browser will move this timestamp to your browser timezone (UTC+2) => 2022-09-18 02:00:00. So it is still the same timestamp, but in different timezone. It is absolutely correct.

Set dashboard timezone to UTC if you want to see 00:00 instead of 02:00.
You can also set timezone offset for timegrouping on the InfluxQL level, but wouldn’t use, because that introduce another problems (e.g. Daylight Saving Time).

1 Like

Thank you the tz() works 100%. Luck I am not concerned about Daylight Saving Time, as we don’t have it.