private XMLGregorianCalendar toXMLGregorianCalendar ( final DateTime date ) { GregorianCalendar gCalendar = new GregorianCalendar ( date . getZone ( ) . toTimeZone ( ) ) ; gCalendar . setTime ( date . toDate ( ) ) ; XMLGregorianCalendar xmlGrogerianCalendar = null ; try { xmlGrogerianCalendar = DatatypeFactory . newInstance ( ) . newXMLGregorianCalendar ( gCalendar ) ; } catch ( DatatypeConfigurationException ex ) { log . error ( ex . getMessage ( ) ) ; System . out . println ( ex . getStackTrace ( ) ) ; } return xmlGrogerianCalendar ; }
Converts java . util . Date to javax . xml . datatype . XMLGregorianCalendar .