Is there a way to specify global settings for Json.net?
The problem we're having is that it puts all DateTimes in UTC (rightly so). For legacy purposes, we want to default to Local time. I don't want to put the following code all over the place:
var settings = New JsonSerializerSettings();
settings.DateTimeZoneHandling = DateTimeZoneHandling.Local;
JsonConvert.DeserializeObject(json, settings);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…