Short of a custom DateTimeConverterBase
implementation, is there some way to keep Json.NET 4.5+, when set to use DateFormatHandling.MicrosoftDateFormat
I found a solution to remove timezone offset from DateTime
for latest version 9.0.0:
var time = DateTime.Now;
Console.WriteLine(JsonConvert.SerializeObject(time, new JsonSerializerSettings()
{
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Unspecified
}));
//"{"thedate": "2016-12-15T09:20:00.9375403"};