We have such an unpleasant problem when the deserialization of a JSON date dates from C # DateTime.
Code:
JavaScriptSerializer serializer = new JavaScriptSerializer(); jsonTrechos = jsonTrechos.Replace("/Date(", "\\/Date(").Replace(")/", ")\\/"); Trecho[] model = serializer.Deserialize<Trecho[]>(jsonTrechos);
jsonTrechos is a string json2.js JSON.stringify(); .
The problem is that deserialization works, and all dates of Trechos objects are added after 2 hours.
My time zone is Brazil (UTC -3), and we are under summer savings (so we are currently in UTC -2) if this is done. I suggest that perhaps localization and time zones can play a role in this, and if they really are, I have no idea how to fix this.
source share