Here you can find the source of formatDate(long millis, Locale locale)
public static String formatDate(long millis, Locale locale)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.util.Date; import java.util.Locale; public class Main { public static String formatDate(long millis, Locale locale) { Date d = new Date(); d.setTime(millis);//from w w w . j a v a 2s. c om return formatDate(d, locale); } public synchronized static String formatDate(Date date, Locale locale) { if (date == null) { return null; } DateFormat format = DateFormat.getDateInstance(DateFormat.FULL, locale); return format.format(date); } }