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; import java.util.TimeZone; public class Main { private static final String DATE_FORMAT = "yyyy-MM-dd'T'HH.mm.ss"; private static final TimeZone UTC = TimeZone.getTimeZone("UTC"); public static String format(Date date) { DateFormat format = new SimpleDateFormat(DATE_FORMAT); format.setTimeZone(UTC);// w w w. j ava2 s . c om return format.format(date); } }