Here you can find the source of formatDate(Date date, String pattern, Locale locale)
public static String formatDate(Date date, String pattern, Locale locale)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String formatDate(Date date, String pattern) { return formatDate(date, pattern, Locale.getDefault()); }//from w ww.j a v a 2 s . c o m public static String formatDate(Date date, String pattern, Locale locale) { SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale); return dateFormat.format(date); } }