Here you can find the source of formatDate(long time)
public static String formatDate(long time)
//package com.java2s; //License from project: Creative Commons License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MMM-dd_HH-mm-ss-SSS_zzz", Locale.ENGLISH);// ww w . java 2 s.c o m public static String formatDate(Date date) { return getDateFormat().format(date); } public static String formatDate(long time) { return formatDate(new Date(time)); } public static DateFormat getDateFormat() { return dateFormat; } }