Here you can find the source of dateTimeToXSDate(Date date)
Parameter | Description |
---|---|
date | the date |
static String dateTimeToXSDate(Date date)
//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); } }