class="java" name="code">Timestamp timestamp = new Timestamp(var2.getXMLGregorianCalendar().toGregorianCalendar().getTimeInMillis());
Timestamp ts = new Timestamp(new Date().getTime()); GregorianCalendar gc = new GregorianCalendar(); gc.setTime(new Date(ts.getTime())); XMLGregorianCalendar cal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc);