Here you can find the source of checkDateInToday(Date date)
public static boolean checkDateInToday(Date date)
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static boolean checkDateInToday(Date date) { if (date == null) { return true; }/* w w w . ja v a 2 s. c o m*/ boolean flag = false; Date now = new Date(); String nowStr = dateToString(now, "yyyy-MM-dd"); String dateStr = dateToString(date, "yyyy-MM-dd"); if (!nowStr.equals(dateStr)) { flag = true; } return flag; } public static String dateToString(Date date, String formartStr) { String strDate = null; if ((formartStr != null) && (!"".equals(formartStr))) { SimpleDateFormat sdf = new SimpleDateFormat(formartStr); strDate = sdf.format(date); } return strDate; } }