Thank you very much for your help on this subject.
Here is what I can do at the moment:
I’m having a little trouble understanding the InfluxDB code but that’s because I’m a beginner in this language.
I was having trouble with the UTC offset and my TimeZone in UTC+2h with the line of code:
timeDifferenceDuration = duration(v: uint(v: now()) - uint(v: lastRow._time)) // UTC timestamps needs to be converted in UNIX/epoch timestamp with uint(). lastRow._time selects _time column from lastRow variable.
I tinkered with something, but it’s not the best when you change the time:
time1 = uint(v: date.add(d: 2h, to: now()))
//time1 = uint(v: system.time())
time2 = uint(v: lastRow._time)
timeDifferenceDuration = duration(v: time1 - time2) // UTC timestamps needs to be converted in UNIX/epoch timestamp with uint(). lastRow._time selects _time column from lastRow variable.
Now, I need to understand better how influxDB2 works, particularly so as not to fixe the dates like this:
|> range(start: 2023-10-17T21:57:00Z, stop: 2023-10-18T21:57:00Z) // Here use time range in which you find your original (imported) data
In any case, thank you to both of you and then to the Grafana team.
I discovered the tool and I must admit that it is rather well designed and powerful.
Thank you all.