Link Details

By default XJC, which is used to create Java classes from XML Schema, maps date, time and datetime XSD types to XMLGregorianCalendar in Java. Since java.util.Date is mostly used type to represent date and time in Java, we often needs to convert between XMLGregorianCalendar and Date. This article explains, How to convert XMLGregorianCalendar to Date in Java and vice-versa.

Posted by screener  |   Feb 20 2013 / 21:26

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Comments

User 388907 avatar

MCII replied ago:

" It's possible to customize XJC to generate Date instead of XMLGregorianCalendar " Yes!!

Reply 0 votes

Recommended Links

Scala
Written by: Ryan Knight
Featured Refcardz: Top Refcardz:
  1. Apache Hadoop
  2. Play
  3. Akka
  4. Debugging JavaScript
  5. Design Patterns
  1. Apache Hadoop
  2. REST
  3. Java
  4. Git
  5. Java Performance
Connect with DZone