Here you can find the source of getCalendar(final long timeInMillis)
public static Calendar getCalendar(final long timeInMillis)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Calendar getCalendar(final Date date) { final GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date);//from w w w . jav a 2 s . c o m return cal; } public static Calendar getCalendar(final long timeInMillis) { return getCalendar(new Date(timeInMillis)); } }