MVC 后台处理 json格式的日期

首先创建一个basecontrol,

  protected ContentResult JsonDate(object Data)
        {
            //将json中带时间的数据进行格式处理
            var timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy-MM-dd HH:mm:ss" };
            return Content(JsonConvert.SerializeObject(Data, Formatting.Indented, timeConverter));
        }

return JsonDate(new { draw = draw, recordsTotal = totalcount, recordsFiltered = totalcount, data = pl });         
        


 
原文地址:https://www.cnblogs.com/daniel-niu/p/10435211.html