Here you can find the source of isBefore(Date date)
public static boolean isBefore(Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static boolean isBefore(Date date) { return getCurrentDateTime().before(date); }//ww w . j a v a2s.c o m /** * Gets the current date time. * * @return the current date time */ public static Date getCurrentDateTime() { Calendar calendar = Calendar.getInstance(); return calendar.getTime(); } }