Here you can find the source of getCalendar(Date date)
public static Calendar getCalendar(Date date)
//package com.java2s; /**// w ww . j av a 2 s . c om * License: https://github.com/votingsystem/votingsystem/wiki/Licencia */ import java.util.Calendar; import java.util.Date; public class Main { public static Calendar getCalendar(int year, int month, int day) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1);//Zero based calendar.set(Calendar.DAY_OF_MONTH, day); return calendar; } public static Calendar getCalendar(Date date) { Calendar result = Calendar.getInstance(); result.setTime(date); return result; } }