Here you can find the source of toCalendar(long millis)
public static Calendar toCalendar(long millis)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Calendar toCalendar(Date date) { Calendar c = new GregorianCalendar(); c.setTime(date);/* w w w . j av a2 s.co m*/ return c; } public static Calendar toCalendar(long millis) { Calendar cal = new GregorianCalendar(); cal.setTime(new Date(millis)); return cal; } }