Hi all,
Trying to convert timestamp for my database.
My sensor outputs timestamp in this format 2022-03-22T06:17:28:410209Z
which I believe is RFC3339 according to influxdb
But to my knowledge influxdb node only accepts timestamp in unix time and when trying to upload with that timestamp, I get unable to parse 'topic measurement="value" 2022-03-22T06:17:28:410209Z': bad timestamp
How can I convert this from RFC3339 to Unix Timestamp?
This is important as my sensors are wireless and they tend to drop connection but will still queue the outputs accordingly with timestamps included and send all when connected again
Here is the flow im playing around with to debug it
[{"id":"215c70b.6c8cf9","type":"change","z":"2c8ee17f.1fe80e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[\t {\t \"measurement\": msg.topic,\t \"fields\": msg.payload,\t \"timestamp\": msg.timestamp\t }\t] ","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":300,"wires":[["e4439b3a42847739","d6929422ed15285f"]],"info":"To change the "},{"id":"88dd3939f719bca0","type":"inject","z":"2c8ee17f.1fe80e","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"timestamp","v":"2022-03-22T06:17:28:410209Z","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"topic","payload":"{\"measurement\":69}","payloadType":"json","x":490,"y":300,"wires":[["215c70b.6c8cf9"]]},{"id":"e4439b3a42847739","type":"debug","z":"2c8ee17f.1fe80e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1100,"y":300,"wires":[]},{"id":"d6929422ed15285f","type":"influxdb batch","z":"2c8ee17f.1fe80e","influxdb":"d32d1a0b4684e895","precision":"","retentionPolicy":"","name":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"Initial_Organization","bucket":"test","x":1100,"y":360,"wires":[]},{"id":"d32d1a0b4684e895","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"out","usetls":false,"tls":"","influxdbVersion":"2.0","url":"http://localhost:8086","rejectUnauthorized":true}]