Here you can find the source of isSameDate(Date date, Date date1)
public static boolean isSameDate(Date date, Date date1)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameDate(Date date, Date date1) { return getDateField(date, Calendar.YEAR) == getDateField(date1, Calendar.YEAR) && getDateField(date, Calendar.MONTH) == getDateField(date1, Calendar.MONTH) && getDateField(date, Calendar.DATE) == getDateField(date1, Calendar.DATE); }/* w ww . jav a 2s.com*/ public static int getDateField(Date date, int field) { Calendar ca = Calendar.getInstance(); ca.setTime(date); return ca.get(field); } }