How do I render DateTime after it passes through Json
Our C# DateTime property comes through Json like this:
/Date(1450674000000)/
How do we make that properl开发者_如何学JAVAy formatted as a date so we can display it in our HTML Tables?
As Lazarus suggested you could format it to a string representation of the date before serializing. You might need to add a new string property though. (i'm assuming you don't need the time component of the date object)
formatting could be done as shown below.
string dateStr = dateObject.ToString("dd-MMM-yyyy"); // format depends on your need or preference
Hope this helps.
I'd suggest formating it before you serialise it to Json.
精彩评论