New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support modern java.time types for getters (first draft) #1351
base: master
Are you sure you want to change the base?
Conversation
5c31302
to
d7d9bf1
Compare
if (parent != null) | ||
return parent.getDefaultZoneId(); | ||
|
||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the different behavior here compared to getDefaultTimezone: It returns null in case nothing is defined and does not fall back to the system default.
SonarCloud Quality Gate failed. 0 Bugs 66.6% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer to do not consider the "corresponding" TM/DA attribute for DA/TM attributes.
Instead I propose to return
VR | &ZZXX | TimeZone | DST | Class |
---|---|---|---|---|
DT | yes | * | * | OffsetDateTime |
DT | no | no | n/a | LocalDateTime |
DT | no | yes | no | OffsetDateTime |
DT | no | yes | yes | ZonedDateTime |
DA | n/a | * | * | LocalDate |
TM | n/a | no | n/a | LocalTime |
TM | n/a | yes | no | OffsetTime |
TM | n/a | yes | yes | LocalTime |
for getTemporal(int tag)
, where TimeZone falls back to defaultTimeZone,
Alternatively to
VR | &ZZXX | TimeZone | DST | Class |
---|---|---|---|---|
TM | n/a | yes | yes | LocalTime |
you may return
VR | &ZZXX | TimeZone | DST | Class |
---|---|---|---|---|
TM | n/a | yes | yes | OffsetTime |
with setting as offset
- either the Offset of the TimeZone at current date and time
- or the Raw (without DST Saving) Offset of the TimeZone
And provide also getTemporal(long datmTag)
(datmTag = (daTag << 32) | tmTag
) returning
DA | TM | TimeZone | DST | Class |
---|---|---|---|---|
no | * | * | * | null |
yes | no | * | * | LocalDate |
yes | yes | no | n/a | LocalDateTime |
yes | yes | * | * | OffsetDateTime |
yes | yes | yes | no | OffsetDateTime |
yes | yes | yes | yes | ZonedDateTime |
Alternatively to
DA | TM | TimeZone | DST | Class |
---|---|---|---|---|
no | * | * | * | null |
you may return
DA | TM | TimeZone | DST | Class |
---|---|---|---|---|
no | no | * | * | null |
no | yes | no | n/a | LocalTime |
no | yes | yes | no | OffsetTime |
no | yes | yes | yes | LocalTime |
and - as above - alternatively to
DA | TM | TimeZone | DST | Class |
---|---|---|---|---|
no | yes | yes | yes | LocalTime |
you may return
DA | TM | TimeZone | DST | Class |
---|---|---|---|---|
no | yes | yes | yes | OffsetTime |
with setting as offset
- either the Offset of the TimeZone at current date and time
- or the Raw (without DST Saving) Offset of the TimeZone
Hi @gunterze , thanks a lot for the detailled feedback on this one. Sorry for the delay now on my side, I am busy with some other stuff at the moment. But I will definitely follow-up on this PR. Thanks again! |
Add a getTemporal(.) method to Attributes which returns one of the modern java.time types (ZonedDateTime, LocalDateTime).
Motivation:
@gunterze: This is a draft containing some TODOs. I just want to get your general feedback if you agree with the general design and whether I should continue working on this. Thanks!