Xs analysis: date with timezone in Joda LocalDate

When parsing dates and times from XML documents into JodaTime objects, I use a common set of conversion utilities, usually using the parsers and formatting elements provided org.joda.time.format.ISODateTimeFormat.

This works fine in most cases, but this time I see documents with xs:datea format value 2010-08-19Z. This is a valid value xs:date, but none of the standard handler- ISODateTimeFormatgenerated LocalDateones I tried will accept it. The closest I can find is ISODateTimeFormat.dateParser()one that will take quite strange 2010-08-19TZ, but not 2010-08-19Z(pay attention to T).

This is all very annoying because both Joda and XML Schema must strictly adhere to ISO date and time formatting rules, but none of them are, or the specification is fuzzy.

Before I allow defeat and manual display of a custom format, can someone point me to an- ISODateTimeFormatcertified parser that will read this value?

+3
source share
1 answer

, ISO-8601, "Z" . "T" /. , "Z" , , , " " 2010-08-18TZ.

, -, xs: date ISO-8601.

EDIT: ISO 8601. " ", XML Schema Datatypes.

, , , xs: date ISO-8601 (.. "T" ), ISODateTimeFormat.dateParser()?

+1

Source: https://habr.com/ru/post/1760570/


All Articles