I built a query to get a daily spread value (so from midnight to midnight)
My query works as intended and the result is accurate.
However for some reason, the associated timestamp is the previous day at 20:00? why is it and why 20:00? is this timezone related and how can I change this so I get a timestamp within the spread period ? (tried playing with “tz” unsuccessfully)
When I check distinct values they all have correct timestamps within the period.
SELECT spread(“value”) FROM “mcsMQTT” WHERE (“device” = ‘!WEATHER_Acurite-Rain899_rain_mm’) AND time >= 1630296000000ms and time <= 1630382399000ms GROUP BY time(1d) fill(none);
Yes, using InfluxDB,
Thanks for the link.
But no matter which timezone I try to use, I get the following:
Tried both via the GUI and directly in the query.
“SELECT spread(“value”) FROM “mcsMQTT” WHERE (“device” = ‘!WEATHER_Acurite-Rain899_rain_mm’) AND time >= now() - 7d GROUP BY time(1d) fill(none) tz(‘America/Montreal’)”
error:"error parsing query: unable to find time zone America/Montreal"
other zone:
message:"InfluxDB Error: error parsing query: unable to find time zone America/Los_Angeles"
Not sure where the bug is as I’m using 1.8.4…
Anyways, thank you very much for that second option, works perfectly!
However, I guess this would need to be manually adjusted twice a year for DST ?? not good…
Any other potential troubleshooting to look into?
SELECT spread(“value”) FROM “mcsMQTT” WHERE (“device” = ‘!WEATHER_Acurite-Rain899_rain_mm’) AND time >= now() - 7d GROUP BY time(1d,4h) fill(none)
Yeah the DST part is tricky with a hardcoded offset. I can’t think of a nice solution to that.
In general I would recommend trying to find a solution to the InfluxDB timezone error. You haven’t shared much about your environment (OS, etc), but comments on the Github issue I linked to does provide some potential fixes for both Windows and Linux (as well as links to further resources on it). You could also check the Influx forum for anything relevant - and/or ask there.
In terms of general troubleshooting, it’s worth simply googling any error that you get - you’re rarely the first person to encounter it, and the search results can lead you to helpful resources.
I’ve tried installing Golang 1.17 Downloads - The Go Programming Language and restart as suggested but still not working. Guess I’m out of options; will follow the thread for any other solutions.
Thanks