Node-influx timestamp with ns precision



i am using the package node-influx.
I am trying to convert a iso date “2016-06-10T21:42:24.760738998Z” (ns precision) to a timestamp with nano second precision in order to send it to influx. any ideas how to convert? Is there something ready and working out there?


until i find another solution i will create the timestamp myself.
since Date.parse() returns the unix time in milliseconds i will append to the above micro and nanoseconds.

Date.parse("2016-06-10T21:42:24.760738998Z") returns 1465594944760

and i append

"2016-06-10T21:42:24.760738998Z".substr(isoTimestamp.length - 7, 6); which returns 738998

which results in


@mantzas Thats the best way I’ve found to do it in JS.