Here you can find the source of getCalendar(Date date)
public static Calendar getCalendar(Date date)
//package com.java2s; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static Calendar getCalendar(Date date) { Calendar calendar = GregorianCalendar.getInstance(); if (date == null) { calendar.setTime(new Date()); } else {/*ww w .ja v a2 s. c o m*/ calendar.setTime(date); } return calendar; } }