Java XML Date getXMLDate(final Date date)

Here you can find the source of getXMLDate(final Date date)

Description

Converts Date into XML-Tag with type xsd:dateTime

License

Open Source License

Declaration

public static String getXMLDate(final Date date) 

Method Source Code

//package com.java2s;

import java.util.Calendar;
import java.util.Date;

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**/*w  ww.  j  a v  a2  s.  com*/
     * Converts Date into XML-Tag with type xsd:dateTime
     */
    public static String getXMLDate(final Date date) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        return DatatypeConverter.printDateTime(calendar);
    }
}

Related

  1. dateToXsdDateTime(Date date)
  2. extractXsdDatetime(String string)
  3. formatXmlDate(Calendar cal)
  4. getDateTimeRepresentation(Calendar date)
  5. getDateTimeString(Date dateTime)
  6. getXSDDateTimeFromCalendar(Calendar calTime)
  7. isPreEIDAS(Date date)
  8. isValidDateUpdatedType(Calendar value)
  9. printDate(final Calendar date)