Here you can find the source of date2String(String formater, Date aDate)
public static String date2String(String formater, Date aDate)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.*; public class Main { public static String date2String(String formater, Date aDate) { if (formater == null || "".equals(formater)) return null; if (aDate == null) return null; return new SimpleDateFormat(formater).format(aDate); }//w w w .j a v a 2 s . com public static String date2String(String formater) { return date2String(formater, new Date()); } }