I'm trying to map a xml DateTime element using jaxb so that it does not care about timezone information at all. Either by rejecting the input, or by treating it as server default timezone. e.g.
<dateTime>2011-01-01T06:00:00-04:00:00</dateTime>
would be treated the same as
<dateTime>2011-01-01T06:00:00</dateTime>
Right now GregorianCalendar automatically converts any dateTime with timezone information to GregorianCalendar object, so I don't know what the original input was. Can anyone shine some light on this? I'm open to use other dateTime types other than GregorianCalendar too, is there a graceful way to use org.joda.time.DateTime
object with jaxb/xml maybe?
Thanks in advance.
There is a useful post on Joda and JAXB from Blaise Doughan using an @XmlJavaTypeAdapter
which you should be able to use to convert the time format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With