Here you can find the source of equalsDay(final Date date1, final Date date2)
public static boolean equalsDay(final Date date1, final Date date2)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**//from ww w.ja v a2 s . co m * MONTH=2 * */ public static final int MONTH = Calendar.MONTH; /** * Year=1 * */ public static final int YEAR = Calendar.YEAR; public static boolean equalsDay(final Date date1, final Date date2) { final Calendar c1 = Calendar.getInstance(); c1.setTime(date1); final Calendar c2 = Calendar.getInstance(); c2.setTime(date2); return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR) && c1.get(Calendar.MONTH) == c2.get(Calendar.MONTH) && c1.get(Calendar.DAY_OF_MONTH) == c2.get(Calendar.DAY_OF_MONTH); } }