phax / ph-ubl

Java library for reading and writing UBL 2.0, 2.1, 2.2, 2.3 and 2.4 documents
Apache License 2.0
110 stars 40 forks source link

Use Java 8 date time classes #27

Closed phax closed 4 years ago

phax commented 4 years ago

Use the following global bindings:

<xjc:javaType name="java.time.LocalDateTime" xmlType="xs:dateTime" adapter="..." />
<xjc:javaType name="java.time.LocalTime" xmlType="xs:time" adapter="..." />
<xjc:javaType name="java.time.LocalDate" xmlType="xs:date" adapter="..." />
<xjc:javaType name="java.time.Duration" xmlType="xs:duration" adapter="..." />
phax commented 4 years ago

Part of 6.4.0 release. Only Date, Time and DateTime are used.

Penait1 commented 3 years ago

@phax Hey, quick question. Does this mean there is no timezone support anymore? Since only the ZonedDateTime supports a timezone, and the LocalDatime/Time/Date classes not.

phax commented 3 years ago

Hi @Penait1 there was quite some stuggle on my side with all these time zones ;-)

hth

Penait1 commented 3 years ago

@phax Thank you for your quick reply! We were planning to migrate to your new version (think we tried 6.4.0 then) a few weeks ago but that was one of the hurdles. Apparently we were not the only ones and it's already fixed, great to hear

phax commented 3 years ago

Yes, it was an "unfortunate" history, but I am pretty confident that, this solution is now sustainable. Ping me (ideally with a new issue) if you have troubles.