Here you can find the source of isToday(Date date)
public static boolean isToday(Date date)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static boolean isToday(Date date) { Date now = onlyDate(new Date()); Date d = onlyDate(date);/*from www.ja v a 2s .c om*/ return now.equals(d); } public static Date onlyDate(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); } }