json returned datetime field, how to render in human readable format
json returned datetime field, how to render in human readable format
I have bunch of json objects which are returned from my controller. One of them is of type DateTime. On the view page it's rendered as [code]Date(1346997005000)/[/code]
How to display this datetime field having this code in mind
[code]
$('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/AjaxHandler",
"bProcessing": true,
"aoColumns": [
{ "sName": "Id",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return 'View';
}
},
{ "sName": "MyDateTime" }
]
});
[/code]
Thank you
Date field should be in format dd.mm.yy
Update: Tried with
[code] { "sName": new Date(parseInt("MyDateTime".substr(6))) }, [/code]but I'm getting same value [code] /Date(1346997005000)/[/code]
How to display this datetime field having this code in mind
[code]
$('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": "/Home/AjaxHandler",
"bProcessing": true,
"aoColumns": [
{ "sName": "Id",
"bSearchable": false,
"bSortable": false,
"fnRender": function (oObj) {
return 'View';
}
},
{ "sName": "MyDateTime" }
]
});
[/code]
Thank you
Date field should be in format dd.mm.yy
Update: Tried with
[code] { "sName": new Date(parseInt("MyDateTime".substr(6))) }, [/code]but I'm getting same value [code] /Date(1346997005000)/[/code]
This discussion has been closed.