Here you can find the source of equalsWoTime(final Date date1, final Date date2)
public static boolean equalsWoTime(final Date date1, final Date date2)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; public class Main { public static boolean equalsWoTime(final Date date1, final Date date2) { return getZeroTimeDate(date1).equals(getZeroTimeDate(date2)); }// ww w.j av a2s.c om public static Date getZeroTimeDate(final Date date) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); } }