Here you can find the source of format(Date date)
public static String format(Date date)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final String FB_DATE = "yyyy-MM-dd'T'HH:mm:ss'Z'"; public static String format(Date date) { return date == null ? null : getParser().format(date); }//w ww . j av a 2s . c o m private static DateFormat getParser() { return new SimpleDateFormat(FB_DATE); } }