Here you can find the source of isDateInRange(Date startDt, Date endDt, Date theDate)
Parameter | Description |
---|---|
startDt | a parameter |
endDt | a parameter |
theDate | a parameter |
Parameter | Description |
---|---|
ParseException | an exception |
public static boolean isDateInRange(Date startDt, Date endDt, Date theDate) throws ParseException
//package com.java2s; //License from project: Apache License import java.text.ParseException; import java.util.Date; public class Main { /**/*from w w w .ja v a2 s .com*/ * * @param startDt * @param endDt * @param theDate * @return boolean true or false * @throws ParseException */ public static boolean isDateInRange(Date startDt, Date endDt, Date theDate) throws ParseException { //theDate in range? if (theDate.compareTo(startDt) == 0 || theDate.compareTo(endDt) == 0 || (theDate.after(startDt) && theDate.before(endDt))) { return true; } else { return false; } } }