Here you can find the source of getMinDateString(Date date)
public static String getMinDateString(Date date)
//package com.java2s; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public final static String minFormat = "yyyyMMddHHmm"; public static String getMinDateString(Date date) { DateFormat dateFormat = new SimpleDateFormat(minFormat); return formatDateString(date, dateFormat); }//from w w w . ja va 2 s . co m 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); } }