Java XML Date Create getXMLGregorianCalendar()

Here you can find the source of getXMLGregorianCalendar()

Description

get XML Gregorian Calendar

License

Open Source License

Declaration

public static XMLGregorianCalendar getXMLGregorianCalendar() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.GregorianCalendar;

import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;

public class Main {
    public static XMLGregorianCalendar getXMLGregorianCalendar() {
        try {/*from   w w  w  .  j a  v a 2s. c  o m*/
            GregorianCalendar gcal = new GregorianCalendar();
            return DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal);
        } catch (DatatypeConfigurationException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
            return null;
        }
    }
}

Related

  1. getXMLDateString()
  2. getXMLDateStringFromDouble(double d)
  3. getXMLDateTime(Date date)
  4. getXMLFormat(Calendar calendar)
  5. getXmlGregCal(Date dt)
  6. getXMLGregorianCalendar(Date date)
  7. getXMLGregorianCalendar(Date date)
  8. getXmlGregorianCalendar(String unixTime)
  9. getXMLGregorianCalendar(TimeZone timeZone, Locale locale)