Here you can find the source of addDateFormatsToList(Locale locale, TimeZone timeZone, List
static void addDateFormatsToList(Locale locale, TimeZone timeZone, List<DateFormat> formats)
//package com.java2s; import java.text.DateFormat; import java.util.List; import java.util.Locale; import java.util.TimeZone; public class Main { static void addDateFormatsToList(Locale locale, TimeZone timeZone, List<DateFormat> formats) { for (int dateStyle = DateFormat.FULL; dateStyle <= DateFormat.SHORT; dateStyle++) { DateFormat df = DateFormat.getDateInstance(dateStyle, locale); df.setTimeZone(timeZone);//from w ww.ja v a 2s .co m formats.add(df); } } }