question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow alternatives to XMLGregorianCalendar for xsd:dateTime

See original GitHub issue

Currently there’s no way to configure scalaxb to use anything but XMLGregorianCalendar for xsd:dateTime and other time-related types in generated classes. It would be convenient to use java.time.* classes instead, either by default or based on a config value.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:15
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
khajavicommented, Nov 7, 2020

Hey Tristan, @tOverney Great work but here are two notes about your works:

  1. LocalTime does not correspond to the xs:time type because xs:time has timeZoneOffset information in the xmlschema spec. So if we use LocalTime it loss the timeZoneOffset.
  2. Also LocalDate is not correspond to the xs:DateTime. xs:DateTime have timeZoneOffset but LocalDate doesn’t.

This is why I asked that question.

0reactions
ataiscommented, Nov 22, 2020

How about super flexible parameter:

dateTypeClass where user could provide a full path to the desired class. default: javax.xml.datatype.XMLGregorianCalendar some would use org.joda.time.DateTime and others (like me) java.util.String.

You can read in the #543 why this would be important.

Do you think it could work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replacing date of type XmlGregorianCalendar generated by ...
I want to convert date from XmlGregorianCalendar to java.util.Date. Have referred : how replace XmlGregorianCalendar by Date? but not able to ...
Read more >
Converting XMLGregorianCalendar to Date in Java
Using the Java API, we can easily convert XMLGregorianCalendar to XMLGregorianCalendar Date and Date in Java. By the way, it's nice to note...
Read more >
How to convert XMLGregorianCalendar to Date ... - Javarevisited
Java program to convert XMLGregorianCalendar to Date in Java and vice-versa. You can either convert XMLGregorianCalendar to java.util.Date or java.sql.
Read more >
XMLGregorianCalendar.getMillisecond - Java - Tabnine
Returns the lexical form of the XSD dateTime value according to ... Convert an {@link XMLGregorianCalendar} (assumed to be in UTC) into a...
Read more >
Unmarshalling Dates Using JAXB - Baeldung
Let's focus on the xsd:dateTime data type because it's a superset of ... the default mapping for xsd:dateTime is the XMLGregorianCalendar, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found