Commit 0bdfc26
Do not use IsoDateTimeConverter to handle DateTimeOffset (#2270)
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 DateTime1 parent a7ba8cc commit 0bdfc26
File tree
3 files changed
+51
-4
lines changed- src
- Nest/CommonAbstractions/SerializationBehavior
- Tests
- Reproduce
3 files changed
+51
-4
lines changedLines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 50 | + | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
617 | 618 | | |
618 | 619 | | |
619 | 620 | | |
| |||
0 commit comments