Here you can find the source of isNotAfter(Date sDate, Date eDate)
public static boolean isNotAfter(Date sDate, Date eDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { public static boolean isNotAfter(Date sDate, Date eDate) { return (sDate.compareTo(eDate) == 0 || before(sDate, eDate)); }//from w ww .j av a 2 s .c o m public static boolean before(Date sDate, Date eDate) { Calendar sCal = new GregorianCalendar(); sCal.setTime(sDate); Calendar eCal = new GregorianCalendar(); eCal.setTime(eDate); return sCal.before(eCal); } }