C O C O - 3 months ago 9
C# Question

Using toString() changes the value of my date?

I'm using parsing a JSON Object, and it's parsing properly using Newtonsoft.


"signed_date_time":"2016-08-13T22:05:22Z"


Basically when I do

jsonObject["signed_date_time"].ToString();


it returns


8/13/2016 10:05:22 PM


How do I fix this? I want it to to return


2016-08-13T22:05:22Z

Answer

Look for a DateParseHandling property and set it to DateParseHandling.None.