Here you can find the source of getThreadLocalGMTDateFormat(final String format)
public static ThreadLocal<SimpleDateFormat> getThreadLocalGMTDateFormat(final String format)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.SimpleTimeZone; public class Main { public static ThreadLocal<SimpleDateFormat> getThreadLocalGMTDateFormat(final String format) { return new ThreadLocal<SimpleDateFormat>() { @Override//ww w .j a va 2 s . c o m protected SimpleDateFormat initialValue() { return getGMTDateFormat(format); } }; } public static SimpleDateFormat getGMTDateFormat(String strFormat) { SimpleDateFormat format = new SimpleDateFormat(strFormat); format.setCalendar(getGMTCalendar()); return format; } public static Calendar getGMTCalendar() { return Calendar.getInstance(new SimpleTimeZone(0, "GMT")); } }