Influxdb Query Time Format

1,473 views
Skip to first unread message

Jay S

unread,
Nov 29, 2016, 5:19:05 PM11/29/16
to Node-RED
I'm using influxdb to store data from sensors etc. 
When I pass data to a database, the time is recorded in milliseconds on input.
If i view the data using the influx cli, it shows the time in milliseconds.
When i query the data using the influx query node, the time is retrieved as a timestamp in date format, eg 2016-11-29T21:40:48.775Z.

Does anyone know how I can set the precision type for the time in the query so I can get the time out in milliseconds?
I want to be able to pass this data on to the chart ui node and I believe it needs the time in millisecond format.

Julian Knight

unread,
Nov 30, 2016, 2:01:07 AM11/30/16
to Node-RED
A millisecond is a thousandth of a second so the ISO timestamp you are showing does give you milliseconds. :)

But what I think you want is to convert the ISO format STRING into a JavaScript DATE?

isoStr = '2016-11-29T21:40:48.775Z';
msDate
= Date.parse( isoStr );
Reply all
Reply to author
Forward
0 new messages