Java Utililty Methods XML Date Create

List of utility methods to do XML Date Create

Description

The list of methods to do XML Date Create are organized into topic(s).

Method

CalendarxmlCalendarToCalendar(XMLGregorianCalendar cal)
xml Calendar To Calendar
return cal.toGregorianCalendar();
CalendarxmlCalendarToCalendar(XMLGregorianCalendar xmlCalendar)
xml Calendar To Calendar
if (xmlCalendar == null) {
    return null;
return xmlCalendar.toGregorianCalendar();
DatexmlDateToDate(XMLGregorianCalendar xmlCalendar)
xml Date To Date
GregorianCalendar calendar = xmlCalendar.toGregorianCalendar();
return calendar.getTime();
longxmlDateToLong(String s)
xml Date To Long
if (s == null)
    return -1;
try {
    XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendar(s);
    return cal.toGregorianCalendar().getTimeInMillis();
} catch (DatatypeConfigurationException dce) {
    return -1;
longxmlGCtoMillis(XMLGregorianCalendar gc)
xml G Cto Millis
return gc != null ? gc.toGregorianCalendar().getTimeInMillis() : 0L;
GregorianCalendarxmlGregorian2Gregorian(XMLGregorianCalendar xmlGC)
xml Gregorian Gregorian
return xmlGC.toGregorianCalendar();
XMLGregorianCalendarxmlGregorianCalendar()
xml Gregorian Calendar
GregorianCalendar cal = new GregorianCalendar();
return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
DatexmlGregorianCalendarToDate(XMLGregorianCalendar cal)
xml Gregorian Calendar To Date
GregorianCalendar gregorianCalendar = cal.toGregorianCalendar();
return gregorianCalendar.getTime();
DatexmlGregorianCalendarToDate(XMLGregorianCalendar calendar)
Converts XMLGregorianCalendar to java.util.Date in Java
if (calendar == null) {
    return null;
return calendar.toGregorianCalendar().getTime();
DateXMLGregorianCalendarToDate(XMLGregorianCalendar gc)
XML Gregorian Calendar To Date
return new Date(gc.toGregorianCalendar().getTimeInMillis());