I’m getting json datetime object as /Date(1346996934000)/ and I’m adviced to convert this date like this
"aoColumns": [
{
"sName": "JoinDate",
"fnRender" : function(obj, val)
{
var dx = new Date(parseInt(val.substr(6)));
var dd = dx.getDate();
var mm = dx.getMonth() + 1;
var yy = dx.getFullYear();
if (dd <= 9)
{
dd = "0" + dd;
}
if (mm <= 9) {
mm = "0" + mm;
}
return dd + "." + mm + "." + yy;
}
}
]
but the final result is that I’m getting date as NaN.NaN.NaN ?
What can be a problem ?
The given sample date string works fine. You might not be getting the correct data in some record. Check it here.
Live Demo