I tried to deserialize a Json string containing DateTime.MinValueall possible ways, but when the method setis called on my object. The date always changes from -01-01-01- to -01-01-02 -.
Json parsing explicitly contains
"inception_date": "0001-01-01T00:00:00+00:00"
Then I call JsonConverton it:
return JsonConvert.DeserializeObject<T>(json, deserializerSettings);
Where T- this is a basic structure that contains a property: DateTime inception_date { get; set; }. The deserializer settings are as follows:
deserializerSettings = new JsonSerializerSettings()
{
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateParseHandling = Newtonsoft.Json.DateParseHandling.None,
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc
};
But somewhere in the bowels of Newtonsoft.Json.dll, the specified time is converted to the next jObject.
"inception_date": "0001-01-02T00:00:00Z"
, , . ReadJson JsonConverter serializer.Populate(jObject.CreateReader(), target);, target T, jObject - .
- , ? , jObject , , (DateParseHandling.None).
, , Newtonsoft JsonConvert, .
, , JsonConvert:

dateParseHandling None, .
Newtonsoft JsonConverter, , . JsonReader dateParseHandling:

- , DateTime - jObject DateTime, - , , DateTime, UTC, .