mardi 5 mai 2015

DateTimeZoneHandling.RoundtripKind is not preserved datetime timezone

I have below code:

                JsonReader reader = new JsonTextReader(new    StringReader(content.ToString()));
                reader.DateTimeZoneHandling =            DateTimeZoneHandling.RoundtripKind;
                reader.DateFormatString = "yyyy-MM-dd HH:mm:ss";
                reader.DateParseHandling = DateParseHandling.DateTime;
                 myObj = JObject.Load(reader);

despite using DateTimeZoneHandling.RoundtripKind; still the date converted to local timezone. For example:

   "2015-02-02T12:01:14.548-0500"

changed to :

   "2015-02-02T11:01:14.548-0500",

Aucun commentaire:

Enregistrer un commentaire