Here you can find the source of isSameDayWithToday(Date date)
public static boolean isSameDayWithToday(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isSameDayWithToday(Date date) { if (date == null) { return false; }// ww w . j a va 2s .c om Calendar todayCal = Calendar.getInstance(); Calendar dateCal = Calendar.getInstance(); todayCal.setTime(new Date()); dateCal.setTime(date); int subYear = todayCal.get(Calendar.YEAR) - dateCal.get(Calendar.YEAR); int subMouth = todayCal.get(Calendar.MONTH) - dateCal.get(Calendar.MONTH); int subDay = todayCal.get(Calendar.DAY_OF_MONTH) - dateCal.get(Calendar.DAY_OF_MONTH); if (subYear == 0 && subMouth == 0 && subDay == 0) { return true; } return false; } }