Json.Net反序列化时间问题

反序列化后有时间差,把时区设置为当前时区就可以了

JsonSerializerSettings jsonSerializerSettings = new JsonSerializerSettings()
{
DateTimeZoneHandling = DateTimeZoneHandling.Local
};
Object obj = JsonConvert.DeserializeObject<Object >(jsonStr, jsonSerializerSettings);

猜你喜欢

转载自www.cnblogs.com/andysu/p/10043250.html
今日推荐