I’m trying to display time as HH:MM in a gauge panel, and I’m not sure what options are available to me to calculate and display that format. Right now, I’m recording a value into my Influx db as nanoseconds since epoch, and I’m retrieving that value, and calculating decimal time in my query like so:
My query in Grafana is :
SELECT (((("timestamp" - "midnight" )/1000000000)/60)/60) FROM "measurement"
1604337300000000000 = "timestamp" in database: Monday, November 2, 2020 11:15:00 AM GMT-06:00 1604296800000000000 = midnight (GMT - 06:00)
my query will return 11.25. I would normally isolate the 0.25 part and then multiply that by 60 (minutes in an hour) to get to :15.
I don’t think InfluxQL can do what I want in the query (but I’m open to doing the calculation in a query).
I don’t know what options are available to me in Grafana, but it seems like transform or override might have the functionality that I need. Can anyone point me in the right direction while I’m researching?