Here you can find the source of isToday(Date dateTime)
public static boolean isToday(Date dateTime)
//package com.java2s; import java.util.*; public class Main { public static boolean isToday(Date dateTime) { Calendar someCa = GregorianCalendar.getInstance(); someCa.setTime(dateTime);/*from w ww . j a v a 2s . c o m*/ int syear = someCa.get(Calendar.YEAR); int smonth = someCa.get(Calendar.MONTH); int sday = someCa.get(Calendar.DAY_OF_YEAR); Calendar currentCa = GregorianCalendar.getInstance(); int cyear = currentCa.get(Calendar.YEAR); int cmonth = currentCa.get(Calendar.MONTH); int cday = currentCa.get(Calendar.DAY_OF_YEAR); if (syear == cyear && smonth == cmonth && sday == cday) { return true; } return false; } }