I change the database from InfluxDB 1 to InfluxDB 2. The data from the electricity meter is stored in UTC format. I evaluate the data for days, months and years. Under InfluxDB 1 the code looks like this:
SELECT non_negative_difference(last(“value”)) FROM “stromzaehler” WHERE (“measurement” = ‘KW/h’) AND $timeFilter GROUP BY time($__interval) tz(‘CET’)
The data is evaluated here for the current day starting at 0:00 local time.
It works very well.
Now I start over under InfluxDB 2 and first compile the data for the current day.
|> range(start: today())
|> filter(fn: (r) => r["_measurement"] == “stromzaehler”)
Unfortunately, I now had to find out that the acquisition for the current day begins according to UTC. This means that I am missing the data according to my local time of 1 hour.
How can I adapt the code accordingly so that the data is recorded from UTC+1 winter time or UTC+2 summer time?