Skip to content
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

Using OffsetDateTime is questionable #110

Closed
sbublava opened this issue Jan 22, 2024 · 1 comment
Closed

Using OffsetDateTime is questionable #110

sbublava opened this issue Jan 22, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sbublava
Copy link

Version 10 moved from XMLGregorianCalendar to OffsetDateTime.

This is a bad choice because:

  1. Zone offsets are optional (quote from ISO20022_MDRPart2_GeneralMeeting_2021_2022.pdf):
ISODateTime

Definition: A particular point in the progression of time defined by a mandatory date and a mandatory
time component, expressed in either UTC time format (YYYY-MM-DDThh:mm:ss.sssZ), local time with
UTC offset format (YYYY-MM-DDThh:mm:ss.sss+/-hh:mm), or local time format (YYYY-MMDDThh:
mm:ss.sss). These representations are defined in "XML Schema Part 2: Datatypes Second
Edition - W3C Recommendation 28 October 2004" which is aligned with ISO 8601. [...]
  1. OffsetDateTime does not support the concept of unknown / missing time zones. With XMLGregorianCalendar it was possible to check fields against FIELD_UNDEFINED:
XMLGregorianCalendar calendar = ...;
if (calendar.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    ...
}

I can work around this issue by replacing com.prowidesoftware.swift.model.mx.adapters.OffsetDateTimeAdapter.

There is no action required from your side, I just wanted to point out this problem. (Maybe the default adapter could treat missing offsets as system time zone, but that's also questionable. The time zone of the sender would be better, but cannot be determined from the MX message.)

@sbublava
Copy link
Author

I was confused. Please ignore this issue.

com.prowidesoftware.swift.model.mx.adapters.OffsetDateTimeAdapter.parseZonedDateTime(DateTimeFormatter, String) handles values without zone offset.

@zubri zubri added the question Further information is requested label Jan 30, 2024
@zubri zubri closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants