Using import timezone in external (nodered) query
SgtErnestBilko opened this issue · 0 comments
SgtErnestBilko commented
In Fluxdb 2.6.1 this query returns data in local time
import “timezone”
option location = timezone.location(name: “Europe/London”)
from(bucket: “AshTree_AAGSolo_2days”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “aagsolodata”)
|> filter(fn: (r) => r[“Category”] == “Ambient temp”)
|> drop(columns: [“_start”, “_stop”, “_field”, “_measurement”])
but in nodered this query returns data in UTC
‘import “timezone”\n’ +
‘option location = timezone.location(name: “Europe/London”)\n’ +
‘from(bucket: “AshTree_AAGSolo_2days”)’ +
'|> range(start: ’ + stimestart + ', stop: ’ + stimenow + ‘)’ +
‘|> filter(fn: (r) => r[“_measurement”] == “aagsolodata”)’ +
‘|> filter(fn: (r) => r[“Category”] == "’ + category + ‘“) ’ +
'|> drop(columns: [”_start", “_stop”, “_field”, “_measurement”])’
I need the data in local time. How do I get the data in local time, please ?