Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
timeConverter.DateTimeFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss";
string json = Newtonsoft.Json.JsonConvert.SerializeObject(ds, timeConverter);
转载于:https://www.cnblogs.com/wahaccp/p/3296219.html