I have a rest call that returns this (using the Advance Rest Client in Chrome for testing):
MyObject: [22] 0: { ID: "123456" UTC1: "2013-04-19T03:12:32Z" UTC2: "2013-04-19T03:12:36.994Z" }
The code that captures the response and serializes it for the object is as follows:
IRestResponse<List<MyObject>> response = client.Execute<List<MyObject>>(request);
When I look at the response object, one of the dates is incorrect. If I inspect it or use objects anyway, I get the following:
UTC1: 4/19/2013 3:12 UTC2: 4/18/2013 9:12:36 PM <--CONVERTED!!
I need both to be serialized as the time that is returned in the response, and not converted from UTC / GMT to local time. As you can see above, one value stores the UTC value and the other in my time zone. I realized that both are executed via the Convert.DateTime function, but if I do this using strings, both values ββcome out as converted to local time. I understand that one of the initial values ββ(the one that is converted) does not comply with the ISO 8601 standard (too much accuracy); unfortunately, this is the data that I have to work with now.
Can someone tell me how to get RestSharp to make sure both dates are in UTC?
Mario source share