Here you can find the source of getSdf(String formatPattern)
public static SimpleDateFormat getSdf(String formatPattern)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; public class Main { private static ThreadLocal<SimpleDateFormat> sdfLocal = new ThreadLocal<SimpleDateFormat>(); public static SimpleDateFormat getSdf(String formatPattern) { SimpleDateFormat sdf = sdfLocal.get(); if (sdf == null) { sdf = new SimpleDateFormat(formatPattern); sdfLocal.set(sdf);//from w ww.j a v a 2 s. c o m } return sdf; } }