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: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean isSameDay(Date day1, Date day2) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String ds1 = sdf.format(day1); String ds2 = sdf.format(day2); if (ds1.equals(ds2)) { return true; } else {/*from www . j a va 2 s .c o m*/ return false; } } }