Here you can find the source of getFormat(String pattern)
public static DateFormat getFormat(String pattern)
//package com.java2s; //License from project: Open Source License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; public class Main { private static final Map<String, DateFormat> DFS = new HashMap<String, DateFormat>(); public static DateFormat getFormat(String pattern) { DateFormat format = DFS.get(pattern); if (format == null) { format = new SimpleDateFormat(pattern); DFS.put(pattern, format);/* ww w. j a v a 2 s. c o m*/ } return format; } }