f-angi
1/4/2016 - 1:13 PM

Convert a Date to a GregorianCalendar to be passed to a cxf client/server

Convert a Date to a GregorianCalendar to be passed to a cxf client/server

    public XMLGregorianCalendar convertToXmlGregorianCalendar(Date date)
        throws DatatypeConfigurationException {

        GregorianCalendar gregorianCalendar = new GregorianCalendar();
        gregorianCalendar.setTime(date);
        return DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar);

    }