Java XML Date getDateTimeRepresentation(Calendar date)

Here you can find the source of getDateTimeRepresentation(Calendar date)

Description

Given a Calendar instance, returns its String representation according to XSD standards.

License

Apache License

Parameter

Parameter Description
date a parameter

Declaration

public static String getDateTimeRepresentation(Calendar date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import javax.xml.bind.DatatypeConverter;

public class Main {
    /**//from  w w w  . j  a v a2  s .  co  m
     * Given a Calendar instance, returns its String representation 
     * according to XSD standards. If the given value is <code>null</code>,
     * returns the empty string.
     * @param date
     * @return
     */
    public static String getDateTimeRepresentation(Calendar date) {
        return null != date ? DatatypeConverter.printDateTime(date) : "";
    }
}

Related

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