//ISO日期转换为UTC日期 public XMLGregorianCalendar xmlToDate(Date date){ GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date); XMLGregorianCalendar gc = null; try { gc = DatatypeFactory.newInstance().newXMLGregorianCalendar(cal); } catch (Exception e) { e.printStackTrace(); } return gc; } //UTC日期转换为ISO日期 public Date DateToXML(XMLGregorianCalendar gc){ GregorianCalendar ca = gc.toGregorianCalendar(); return ca.getTime(); }