Newtonsoft.Json日期格式定义

来源:互联网 发布:淘宝c店如何推广 编辑:程序博客网 时间:2024/05/29 03:02

Newtonsoft.Json日期格式定义,参考代码如下:

IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";
Newtonsoft.Json.JsonConvert.SerializeObject(Object, timeConverter);

原创粉丝点击