Skip to content

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Sep 20, 2016

Forward port of 4ea007c

IsoDateTimeConverter deserializes a DateTimeOffset represented in an ISO8601 into a DateTimeOffset with a local offset. For example "1999-01-01T01:01:01.001+05:00" deserializes to a DateTimeOffset with a value of 01/01/1999 07:01:01 +11:00. The +11 offset is my local offset (Australia). The default deserialization for a DateTimeOffset not using IsoDateTimeConverter deserializes into a DateTimeOffset with an offset that reflects the one in the ISO8601 string representation. This seems more appropriate behaviour.

Use InvariantCulture in the IsoDateTimeConverter when deserializing DateTime

Forward port of 4ea007c

IsoDateTimeConverter deserializes a DateTimeOffset represented in an ISO8601 into a DateTimeOffset with a local offset. For example "1999-01-01T01:01:01.001+05:00" deserializes to a DateTimeOffset with a value of 01/01/1999 07:01:01 +11:00. The +11 offset is my local offset (Australia). The default deserialization for a DateTimeOffset not using IsoDateTimeConverter deserializes into a DateTimeOffset with an offset that reflects the one in the ISO8601 string representation. This seems more appropriate behaviour.

Use InvariantCulture in the IsoDateTimeConverter when deserializing DateTime
@gmarz gmarz merged commit 0bdfc26 into 5.x Oct 25, 2016
@gmarz gmarz deleted the fix/5.x-datetimeoffset-deserialization branch October 25, 2016 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants