Time column - InfluxQL

Grafana V11.0

Hello. I am trying to sum values inside InfluxDB from Grafana using InfluxQL. I seem to have an issue with the time column. Using the following query in a table visual I get the expected time

SELECT sum("value") 
FROM "weight" 
WHERE ("tagName"::tag = 'Net_Weight_Head_2') 
AND time >= now() - 1h


The time on my PC is 14:42, 10th of Feb.

Using a query like the following, gives me no data.

SELECT sum("value") 
FROM "weight" 
WHERE ("tagName"::tag = 'Net_Weight_Head_2') 
AND time >= '2025-02-10T06:00:00Z'

Any suggestions as to what might be happening?

Welcome @cameron200sx

Are the values in your Influx Database stored in UTC? How many hours difference between your timezone and UTC?

Hi Grant, good question, thanks for your help. I personally do not have access but can try work this out. I stream the values from a PLC to InfluxDB via OPCRouter. Is some kind of conversion automatically used when performing different types of queries as I have above? Makes sense if I am in a timezone +13hr UTC. I’ll run some more tests at :slight_smile:

Yes, seems the data is being stored in UTC as querying for 13hr1min before will produce a result. 12hr59min before will not. Now I need a way to possibly have a variable that gets 4 timestamps to use inside of a query that change based on what time it is. 6am - 6pm. 6pm to 6am