Json.NET Deserialize Object change the timezone to local time?
andro
118
Points
3
Posts
|
I'm using json.net ' JsonConvert' to deserialize a DateTimeOffset, but it is ignoring the specified timezone and converting the datetime to the local offset. For example, as
When deserialised using:
The json obj returning a property containing a DateTimeOffset but the value will be 2018-07-19T15:30:00+10:30 i.e. converted to the local timezone instead of preserving the original timezone. Is there any way to get the value to be parsed as expected so that the resulting DateTimeOffset property will match the supplied one? It seems to be ignoring DateParseHandling.DateTimeOffset and is using DateParseHandling.DateTime - Rahul Maurya 28-Apr-2018 05:01
|
Answers
Blog
Active User (0)
No Active User!