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