0

I have a controller that passes a List of objects from a database. Each one has a timestamp of type DateTime. I want to display that in a jQuery DataTable, so I pass the List via JSON to my view. However, each Timestamp is displayed as follows:

/Date(1466823108106)/

The code that returns the JSON is as follows:

return Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = retData }, JsonRequestBehavior.AllowGet);

Any way to keep these parameters and have the Timestamp be readable? Or is that something that should be done on the jQuery Datatables side?

Sergey Smirnov
  • 303
  • 4
  • 11
  • Oftern easiest to just format the date to a string on the server –  Jun 25 '16 at 03:14
  • Check this link:http://codeasp.net/blogs/microsoft-net/1306/convert-json-date-to-javascript-date adn demo :http://codeasp.net/assets/demos/blogs/convert-net-datetime-to-javascript-date.aspx – Shashank Sood Jun 25 '16 at 04:52

0 Answers0