Here you can find the source of isToday(final Date date)
public static boolean isToday(final Date date)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { /**// w ww . j a va2 s . co m * Day=5 * */ public static final int DAY = Calendar.DAY_OF_MONTH; /** * MONTH=2 * */ public static final int MONTH = Calendar.MONTH; /** * Year=1 * */ public static final int YEAR = Calendar.YEAR; public static boolean isToday(final Date date) { final Calendar calendar = Calendar.getInstance(); calendar.setTime(date); final int year = calendar.get(YEAR); final int month = calendar.get(MONTH); final int day = calendar.get(DAY); final Calendar today = Calendar.getInstance(); today.setTime(now()); final int tyear = today.get(YEAR); final int tmonth = today.get(MONTH); final int tday = today.get(DAY); final boolean result = tyear == year && tmonth == month && tday == day; return result; } public static Date now() { return new Date(); } }