Calculate with time in Unixformat (ns)

Hello all,

I am using Grafana and Influx DB and have troubles to calculate with times.

For my query I use the elapsed() function which gives me a result in ns Unix time. Thats fine. Now I struggle with a simple calculation of this ns time * 15. I dont get any result.

Tried to use time() to convert it but also didnt work.

Has someone the solution how to use a ns time for a multiplication?

Thanks in advance.

Best regards

Hello @HMLA,
The following worked for me:

import "universe"
import "array"

array.from(rows: [{_time: 2019-09-18T12:00:00.000000000Z, _value: 1}, {_time: 2019-09-19T12:00:00.000000000Z, _value: 2}])
  |> universe.elapsed(    )
  |> (r) => ({r with _mult: r.elapsed * 15 }) )