I've been having an issue with Web API parsing datetimes incorrectly which I have tracked down to JSON.NET.
The issue is that if I send this datetime:
2015-07-28T19:06:01.000+00:00
in a JSON PUT request, the DateTime parsed in my model will be converted to a time in the local server timezone, with the C# datetime kind of local, not UTC.
If I send this datetime:
2015-07-28T19:06:01.000Z
It will correctly keep it as UTC, with the C# datetime kind of UTC which is what I want.
I can fix this, by setting the DateTimeZoneHandling like this:
SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
But I don't understand why it does this in the first place. According to ISO8601, Z and +00:00 should mean the same thing right? I'm worried about setting the DateTimeZomeHandling to UTC globally as I might not want every single date on my endpoint to be considered UTC.
Is there another setting where I can tell it to consider +00:00 to mean UTC?