Here you can find the source of getLongFormat(Date date)
public static String getLongFormat(Date date)
import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; import java.util.TimeZone; public class Main{ public static final String LOCAL_LONG_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; public static String getLongFormat(Date date) { if (date == null) { return null; }/* www.java 2s . c o m*/ return getFormatString(date, LOCAL_LONG_DATE_FORMAT); } public static String getFormatString(Date date, String dateFormat) { if (date == null || StringUtil.isEmpty(dateFormat)) { return null; } return new SimpleDateFormat(dateFormat, Locale.ENGLISH) .format(date); } }