I have tried moment.js
, parsing it to string etc. I found no luck in converting it to my desired output.
I have this code
console.clear();
var date = [];
$.ajax({
url: "https://api.myjson.com/bins/1dqpsd",
dataType: "json",
success: function (result) {
//console.log(result); //Now a JSON object
for (var i in result){
//console.log(result[i]);
date[i] =result[i].commit);
console.log(date[i]);
}
}
});
This returns a format like
"2017-07-22T19:36:50.000+12:00"
"2017-07-22T14:46:40.000+12:00"
"2017-07-21T22:46:18.000+12:00"
"2017-07-20T19:32:10.000+12:00"
I want to be able to convert it to something like
July 22, 2017 6:36 PM
July 22, 2017 2:46 PM