Answer the question
In order to leave comments, you need to log in
How to properly pass json to mysql datetime?
there is an api that eventually streams me this json with (sometimes less than a second):
{"data":"someData", "time":"2017-05-09T11:11:59.239549539Z"}
each stream is inserted into mysql:
db .query('INSERT INTO `table_name` SET `data`=?, `time`=?', [jsondata.data, jsondata.time]);
How do I convert this "2017-05-09T11:11:59.239549539Z" into the correct format for insert. But it is necessary that if the requests in the same second differ by date (it was possible to sort)
Thank you in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question