Here you can find the source of formatFullTime(Date date)
public static String formatFullTime(Date date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; import java.util.TimeZone; public class Main { public static String formatFullTime(Date date) { return formatFullTime(date, TimeZone.getTimeZone("UTC")); }/* w ww .j a v a 2 s . com*/ public static String formatFullTime(Date date, TimeZone timeZone) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); if (timeZone != null) { format.setTimeZone(timeZone); } return format.format(date); } /** * Format date with UTC time zone. * * @param date * @param pattern * @return */ public static String format(Date date, String pattern) { SimpleDateFormat sdf = new SimpleDateFormat(pattern); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(date); } }