Instantiate XMLGregorianCalendar

import java.util.GregorianCalendar;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
...
XMLGregorianCalendar today = null;
try {
  today = DatatypeFactory.newInstance()
    .newXMLGregorianCalendar(
        new GregorianCalendar(2008,10,1));
} catch (DatatypeConfigurationException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
}
This entry was posted in xml. Bookmark the permalink.