I have two Date objects which I have set using the calendar setTime() method, I need to check to determine whether or not the day matches but not the time, so for example
//date1 is Sat Feb 17 20:49:54 +0000 2012
//date2 is Sat Feb 17 10:39:58 +0000 2012
cal1.setTime(date1);
cal2.setTime(date2);
if (calOld.equals(calNew)){
}
I need the code to determine if Sat Feb 17 matches but ignore 20:49:54 +0000 2012, thanks in advance
You can use the day of the year field to check if they are equal.