Write XMLGregorianCalendar to java.util.Date

Asked 2 years ago, Updated 2 years ago, 130 views

Is there a way to write XMLGregorianCalendar with java.util.Date?

xml java date

2022-09-22 22:34

1 Answers

GregorianCalendar c = new GregorianCalendar();
c.setTime(yourDate);
XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);


2022-09-22 22:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.