Here you can find the source of formatDate(String strDate, Locale locale)
public static String formatDate(String strDate, Locale locale)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String formatDate(String strDate, Locale locale) { String ret = ""; SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Date date = null;//from w w w . j av a 2s . co m try { date = sdf.parse(strDate); } catch (Exception e) { return ret; } DateFormat df = DateFormat.getDateInstance(DateFormat.LONG, locale); ret = df.format(date); return ret; } }