Here you can find the source of isSameDay(Calendar cal1, Calendar cal2)
public static boolean isSameDay(Calendar cal1, Calendar cal2)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameDay(Date d1, Date d2) { Calendar c1 = Calendar.getInstance(); c1.setTime(d1);// ww w .j ava 2s.com Calendar c2 = Calendar.getInstance(); c2.setTime(d2); return isSameDay(c1, c2); } public static boolean isSameDay(Calendar cal1, Calendar cal2) { return cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && cal1.get(Calendar.MONTH) == cal2.get(Calendar.MONTH) && cal1.get(Calendar.DAY_OF_MONTH) == cal2.get(Calendar.DAY_OF_MONTH); } }