I have a JSON that keeps DateTime values in unix view.
How do I convert it to human readable value using JavaScript? For example:
1503575274000
to 2017-08-24 15:11:54
I am using it to build charts using google visualization, my code looks like this:
function drawChart() {
var jsonData = $.ajax({
url: "jsonUrl",
type: "GET",
dataType: 'json',
async: "false"
}).done(function (jsonData) {
var data = new google.visualization.DataTable();
data.addColumn('number', 'dateExecutes');
data.addColumn('number', 'passed');
data.addColumn('number', 'failed');
jsonData.forEach(function (row) {
data.addRow([
row.dateExecutes,
row.passed,
row.failed,
]);
});
I also need to use regular date format instead of DateExecutes