Android Time Format dateTimeToXSDateTime(Date date)

Here you can find the source of dateTimeToXSDateTime(Date date)

Description

* Dates the DateTime into an XML schema date time.

License

Open Source License

Parameter

Parameter Description
date the date

Return

String representation of DateTime.

Declaration

protected static String dateTimeToXSDateTime(Date date) 

Method Source Code

//package com.java2s;

import java.text.DateFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    /**/*  w  w  w. j av  a 2  s .c  om*/
     * * Dates the DateTime into an XML schema date time.
     * 
     * @param date
     *            the date
     * @return String representation of DateTime.
     */
    protected static String dateTimeToXSDateTime(Date date) {
        String format = "yyyy-MM-dd'T'HH:mm:ss'Z'";
        DateFormat utcFormatter = new SimpleDateFormat(format);
        return utcFormatter.format(date);
    }
}

Related

  1. getTimeStr(long time)
  2. getTimeString(Date utcDate)
  3. getTimeString(String dateString)
  4. getTimeString(String utcTimeString)
  5. dateTimeToXSDate(Date date)