Here you can find the source of formattedIso8601DateString(Calendar pCal)
public static String formattedIso8601DateString(Calendar pCal)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String formattedIso8601DateString(Calendar pCal) { Date date = pCal.getTime(); String result = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").format(date); return result + "Z"; }/* w w w . j av a 2 s . c om*/ }