Here you can find the source of isSameDate(Date pathDate, Date now)
public static boolean isSameDate(Date pathDate, Date now)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameDate(Date pathDate, Date now) { Calendar c = Calendar.getInstance(); c.setTime(pathDate);/* www . ja va 2s .c o m*/ Calendar nowCalendar = Calendar.getInstance(); nowCalendar.setTime(now); return c.get(Calendar.DAY_OF_YEAR) == nowCalendar.get(Calendar.DAY_OF_YEAR) && c.get(Calendar.YEAR) == nowCalendar.get(Calendar.YEAR); } }