Here you can find the source of formatAlternativeIso8601Date(Date date)
public static String formatAlternativeIso8601Date(Date date)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.SimpleTimeZone; public class Main { private static final String ALTERNATIVE_ISO8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; public static String formatAlternativeIso8601Date(Date date) { return getAlternativeIso8601DateFormat().format(date); }/*from w w w . j av a2 s. c om*/ private static DateFormat getAlternativeIso8601DateFormat() { SimpleDateFormat df = new SimpleDateFormat(ALTERNATIVE_ISO8601_DATE_FORMAT, Locale.US); df.setTimeZone(new SimpleTimeZone(0, "GMT")); return df; } }