Here you can find the source of isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2)
public static boolean isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static boolean isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2) { if ((aInCal1 == null) && (aInCal2 != null)) { return false; }/*from w w w .ja v a 2s.c o m*/ if ((aInCal2 == null) && (aInCal1 != null)) { return false; } if ((aInCal2 == null) && (aInCal1 == null)) { return true; } if (aInCal1.get(Calendar.DAY_OF_MONTH) != aInCal2.get(Calendar.DAY_OF_MONTH)) { return false; } if (aInCal1.get(Calendar.MONTH) != aInCal2.get(Calendar.MONTH)) { return false; } if (aInCal1.get(Calendar.YEAR) != aInCal2.get(Calendar.YEAR)) { return false; } return true; } }