Here you can find the source of parseDate2String(Date date)
public static String parseDate2String(Date date)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String PATTERN = "yyyy-MM-dd"; public static String parseDate2String(Date date, String pattern) { return getSimpleDateFormatInstance(pattern).format(date); }//from w w w . ja v a2 s . c o m public static String parseDate2String(Date date) { return parseDate2String(date, null); } private static SimpleDateFormat getSimpleDateFormatInstance(String pattern) { return new SimpleDateFormat(pattern == null ? PATTERN : pattern); } }