Json.net 时间格式处理

json.net转json时生成的时间格式是这种 2015-11-14T06:59:59+08:00

格式化为这种2015-11-14

后台代码:

IsoDateTimeConverter timeFormat = new IsoDateTimeConverter();
 timeFormat.DateTimeFormat = "yyyy-MM-dd";
//list为List<sb>类型
return Content(JsonConvert.SerializeObject(list, Newtonsoft.Json.Formatting.Indented, timeFormat));

 

posted @ 2015-11-17 18:15  小小高  阅读(356)  评论(0编辑  收藏  举报