Here you can find the source of isEquals(Calendar sourceDate, Calendar compareDate)
public static boolean isEquals(Calendar sourceDate, Calendar compareDate)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isEquals(Calendar sourceDate, Calendar compareDate) { boolean check = false; if ((sourceDate.get(Calendar.DATE) == compareDate.get(Calendar.DATE)) && (sourceDate.get(Calendar.MONTH) == compareDate.get(Calendar.MONTH)) && (sourceDate.get(Calendar.YEAR) == compareDate.get(Calendar.YEAR))) { check = true;//from w w w . j av a2 s . c om } return check; } public static boolean isEquals(Date sourceDate, Date compareDate) { return isEquals(getCalendar(sourceDate), getCalendar(compareDate)); } public static Calendar getCalendar(Date date) { Calendar calendar = Calendar.getInstance(); calendar.setTime(date); return calendar; } }