Here you can find the source of isBeforeToday(Date date)
public static Boolean isBeforeToday(Date date)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Boolean isBeforeToday(Date date) { Long dateTime = date.getTime(); Long startTodayTime = getStartOfToday().getTime(); if (dateTime < startTodayTime) { return true; } else {/* w w w. j ava 2 s .c o m*/ return false; } } public static Date getStartOfToday() { Calendar today = Calendar.getInstance(); int year = today.get(Calendar.YEAR); int month = today.get(Calendar.MONTH); int day = today.get(Calendar.DAY_OF_MONTH); return new GregorianCalendar(year, month, day, 0, 0, 0).getTime(); } }