Here you can find the source of formatDate(String format, Date date)
public static String formatDate(String format, Date date)
import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Locale; import java.util.Map; import com.jstakun.gms.android.config.ConfigurationManager; public class Main{ public static String formatDate(String format, Date date) { return new SimpleDateFormat(format, ConfigurationManager .getInstance().getCurrentLocale()).format(date); }//from w w w . ja v a2 s. c om }