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