[break] use OffsetDatetime instead of ZonedDateTime#46
Conversation
5dbd974 to
389b6b8
Compare
|
Let's cut 2.0.0 |
|
Really appreciate the PR description - possibly worth explicitly mention that this ZonedDateTime was not compliant with the conjure spec (which required IOS-8601) and that OffsetDateTime does now comply with ISO-8601? |
|
Is it worth tagging an RC version before merging this so that we can give people a helpful guide for how to migrate? |
|
I really think if we're going to break we ought to pay attention to the precision that ZonedDateTime originally offered: https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html In an ideal form, IMO we shouldn't be carrying the offset, and there's an issue with offsets that needs to be dealt with around set equality. |
|
Also, since ZonedDateTime did in fact serialize compatibly, it was in fact spec-compatible (for pedantic readers). |
|
@markelliot, i believe I wrote a quick test to see how Turns out, serialization plus deserialization removes the And I did the same test using |
|
Sorry, “precision” was probably an improper word choice. We’re leaving behind:
|
|
Got it. I added a note about the full timezone information of ZonedDateTime in the implication section. |
|
I am going to tag |
Before this PR
ZonedDateTimewas used for conjure primitivedatetimetype and it is not always compliant with conjure spec which requires date time to be ISO-8601 compliant. It is becauseZonedDateTime's string representation is not compatible with ISO-8601 whenZoneIdandZoneOffsetare differentAfter this PR
OffsetDateTimeclass is used as conjuredatetimeprimitive to be conjure spec compliant becauseOffsetDateTimeguarantees ISO-8601 complianceAccording to
OffsetDateTimejavadocEven though Instant is the simplest date time representation, we favor OffsetDateTime for readability and the flexibility in obtaining local date date time.
Implications
2017-04-26T15:13:12.006+02:00[Europe/Paris]ZonedDateTimeprovides, including the rules to cover daylight saving time adjustments.