Here you can find the source of getLongDateString(Date date)
Parameter | Description |
---|---|
date | a parameter |
public static String getLongDateString(Date date)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String longFormat = "yyyyMMddHHmmss"; /**/*from w w w.j ava 2 s .c o m*/ * yyyyMMddHHmmss * * @param date * @return */ public static String getLongDateString(Date date) { DateFormat dateFormat = new SimpleDateFormat(longFormat); return formatDateString(date, dateFormat); } public static String formatDateString(Date date, DateFormat dateFormat) { if (date == null || dateFormat == null) { return null; } return dateFormat.format(date); } public static String format(Date date, String format) { if (date == null) { return null; } return new SimpleDateFormat(format).format(date); } }