// Compare two dates public static boolean compareDates(Date dDateA, Date dDateB) { // Declare variables GregorianCalendar cDateA = new GregorianCalendar(); GregorianCalendar cDateB = new GregorianCalendar(); // Set dates cDateA.setTime(dDateA); cDateB.setTime(dDateB); // Compare if (cDateA.get(Calendar.MONTH) == cDateB.get(Calendar.MONTH) && cDateA.get(Calendar.YEAR) == cDateB.get(Calendar.YEAR) && cDateA.get(Calendar.DAY_OF_MONTH) == cDateB.get(Calendar.DAY_OF_MONTH)) { return true; } return false; }