JsonConvert转换时DateTime的转换

来源:互联网 发布:个人简介网页制作源码 编辑:程序博客网 时间:2024/06/07 04:06


using Newtonsoft.Json.Converters;
using Newtonsoft.Json;



       IsoDateTimeConverter timeConverter = new IsoDateTimeConverter { DateTimeFormat = "yyyy'-'MM'-'dd HH':'mm':'ss" };
    


      Postdata = JsonConvert.SerializeObject(train, Formatting.Indented, timeConverter);
          




需要引用一下Newtonsoft.Json
这个dll

原创粉丝点击