At the end of the day, the problem that I encounter in this application can be fixed if my server always sends DateTime client objects in a format that all browsers work correctly.
This means that there should be a βZβ at the end. It turns out the ASP.NET MVC4 Json serializer is based on Json.NET, but it is not enabled by default. The default value for DateTimeZoneHandling looks like RoundtripKind , and this does not output the values ββwith Z on them, even if DateTime.Kind == Utc , which is very annoying.
So it seems that the fix sets the way that Json.NET handles time zones before DateTimeZoneHandling.Utc :
var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; // Force Utc formatting ('Z' at end). json.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc;
Now everything from my server to the browser is formatted as ISO-8601 with a βZβ at the end. And all the browsers I tested do it right.
tig
source share