Android Time Format dateTimeToXSDate(Date date)

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

Description

* Convert DateTime to XML Schema date.

License

Open Source License

Parameter

Parameter Description
date the date

Return

String representation of DateTime.

Declaration

static String dateTimeToXSDate(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.  ja v a  2s.c om*/
     * * Convert DateTime to XML Schema date.
     * 
     * @param date
     *            the date
     * @return String representation of DateTime.
     */
    static String dateTimeToXSDate(Date date) {
        String format = "yyyy-MM-dd'Z'";
        DateFormat utcFormatter = new SimpleDateFormat(format);
        return utcFormatter.format(date);
    }
}

Related

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