• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unmarshalling date without timezone with jaxb

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am now trying to unmarshal a date into an XML file by using jaxb. But there is always a timezone offset shown in the generated element, like:

<TRANSFER_DT>2006-08-14+08:00</TRANSFER_DT>

But what I want is:

<TRANSFER_DT>2006-08-14</TRANSFER_DT>

The xsd is like:

<xs:complexType name="Date.CT">
<xs:annotation>
<xs ocumentation>Pattern: YYYY-MM-DD
</xs ocumentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs ate"/>
</xs:simpleContent>
</xs:complexType>

Because the xsd file is provided by 3rd party, I cannot change it in anyway. But I don't have any clue how to get rid of the timezone. I tried to clear the timezone, set the time to 0, but the timezone offset is still here.

I have tried to search for previous posts for related topic. But it seems that there is no answer for it.

Can anyone here please help me?
reply
    Bookmark Topic Watch Topic
  • New Topic