GregorianCalendar c = new GregorianCalendar();
c.setTime(yourDate);
XMLGregorianCalendar date2 = DatatypeFactory.newInstance().newXMLGregorianCalendar(c);
More Related Contents:
- Convert Java Date into XML Date Format (and vice versa)
- How to format java.util.Date with DateTimeFormatter portable?
- How can I increment a date by one day in Java?
- Java SimpleDateFormat(“yyyy-MM-dd’T’HH:mm:ss’Z'”) gives timezone as IST
- SimpleDateFormat and locale based format string
- In Java, how do I parse XML as a String instead of a file?
- Spring schemaLocation fails when there is no internet connection
- How to convert String to Date without knowing the format?
- How to subtract X day from a Date object in Java?
- Get yesterday’s date using Date [duplicate]
- What is the best/simplest way to read in an XML file in Java application? [closed]
- How can I “pretty print” a Duration in Java?
- Is there a more elegant way to convert an XML Document to a String in Java than this code?
- Timezones in SQL DATE vs java.sql.Date
- Getting the last modified date of a file in Java
- Java: Date parsing, why do I get an error
- XML Node to String in Java
- Getting the current time millis from device and converting it into a new date with different timezone [duplicate]
- Convert LocalDate in DD/MM/YYYY LocalDate [duplicate]
- Android Days between two dates
- Converting a Date object to a calendar object [duplicate]
- Java : Convert formatted xml file to one line string
- Java/JAXB: Unmarshall XML attributes to specific Java object attributes
- How create Date Object with values in java
- Simple conversion between java.util.Date and XMLGregorianCalendar
- How to create a XML object from String in Java?
- Java – Reading XML file
- Determine if a String is a valid date before parsing
- How to update xml files in java
- How to read an XML file with Java?