Here you can find the source of isSameDay(Date date1, Date date2)
public static boolean isSameDay(Date date1, Date date2)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isSameDay(Date date1, Date date2) { SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd"); return fmt.format(date1).equals(fmt.format(date2)); }//from w ww .jav a2 s .c o m }