Here you can find the source of getLocalCalendar()
private static final Calendar getLocalCalendar()
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { private static final ThreadLocal<Calendar> localCalendar = new ThreadLocal<Calendar>(); private static final Calendar getLocalCalendar() { Calendar cal = localCalendar.get(); if (cal == null) { cal = Calendar.getInstance(); localCalendar.set(cal);/*from w w w . j a v a2s .c o m*/ } return cal; } }