ASP.NET MVC Controller.Json DateTime Serialization vs NewtonSoft Json DateTime Serialization

后端 未结 4 1655
离开以前
离开以前 2020-12-18 01:42

When I return object that contains DateTime property using

return Json(value);

on client I receive

\"/Date(1336618438854)/         


        
4条回答
  •  温柔的废话
    2020-12-18 02:23

    It returns Server Date Format. You need to define your own function.

    function jsonDateFormat(jsonDate) {
    
    // Changed data format;
    return (new Date(parseInt(jsonDate.substr(6)))).format("mm-dd-yyyy / h:MM tt");
    

    };

提交回复
热议问题