Here you can find the source of isSameDay(Date date1, Date date2)
public static boolean isSameDay(Date date1, Date date2)
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isSameDay(Date date1, Date date2) { return date2String(date1, "yyyy-MM-dd").equals(date2String(date2, "yyyy-MM-dd")); }/* w w w .j av a 2 s .c o m*/ public static String date2String(Date date, String format) { SimpleDateFormat df = new SimpleDateFormat(format); return df.format(date); } }