i am using nodejs to connet to mySql Db. using node is ma able to retrieve all tables . Node is used as a backend with express.
I have a route http://localhost:3000/getALL
when i consume this i get all the data in JSON format. but i am having issues converting mySql time to JS object
[{"file_name":"150412-001070",
"date_time":"2015-07-21T13:11:55.000Z",
"polpospercent":68.95,"polnegpercent":31.05,
"Anger":6.58,
"Surprise":32.87,
"Sadness":32.87,
"Joy":4.59,
"Disgust":13.84,
"Fear":9.26,
"file_ts":"2014-04-26T22:03:00.000Z"}]
I need to convert file_ts to JS date and perform sort on it by Date. This is also not sorted on angularjs ngTable.
new Date("2014-04-26T22:03:00.000Z")do also note that you can sort such ISO strings as text since they all have leading zeros and most-significant digits first. lastly, it's better for more reasons than not to sort in msql,order by file_ts...