Group by Time(1d) odd results

Hello, experts. Forgive a beginner’s question: I’m using InfluxDB with Grafana to work out the daily differences between various values, eg: electricity and gas meter readings at the beginning and end of a day. I have the following query:

SELECT difference(last(“value”)) FROM “MEMT1” WHERE $timeFilter GROUP BY time(1d) fill(null)

However the result of this query is a value summed from 1:00am - 00:59 am rather than from 0:00am to 23:59. I cannot figure out how to force the query to calculate the difference from midnight to midnight. Is this a timezone problem? If so, how can I control the timezone setting? Or is it something else?

Thanks in advance.

One other thing: Influx is running on an RPI where the time and timezone are set correctly - to CET for my location

I am not an expert, but influx works on UTC time zone, and all date
should be entered to influx in UTC. If you change the time zone in the system, influx will change your dates. I know this is not a solution, but try use Change timezone plugging in your browser.