Here you can find the source of getFormat(String pattern)
public static DateFormat getFormat(String pattern)
//package com.java2s; //License from project: Apache 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);/* www . ja v a2s.c o m*/ } return format; } }