Here you can find the source of isSameDay(Date day1, Date day2)
public static boolean isSameDay(Date day1, Date day2)
//package com.java2s; //License from project: Apache License import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static final DateFormat SHORT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); public static boolean isSameDay(Date day1, Date day2) { return SHORT_DATE_FORMAT.format(day1).equals(SHORT_DATE_FORMAT.format(day2)); }/*from w ww . j a va2 s . c o m*/ }