Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. private XMLGregorianCalendar convertDateToXMLGregorianCalendar(Date fromDate) throws OperationFailedException {
  2. GregorianCalendar gregoryFrom = new GregorianCalendar();
  3. gregoryFrom.setTime(fromDate);
  4. XMLGregorianCalendar calendarFrom = null;
  5. try {
  6. calendarFrom = DatatypeFactory.newInstance()
  7. .newXMLGregorianCalendar(
  8. gregoryFrom);
  9. } catch (DatatypeConfigurationException e) {
  10. throw new OperationFailedException("Could not convert date to XMLGregorianDate" + fromDate + " Error :" + e.getMessage());
  11. }
  12. return calendarFrom;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement