Tag Archives: Date Overlap

How to check if 2 Date Ranges Overlap in Java

Code to check if 2 date ranges overlap each other or not. /** * @return boolean true in case the date ranges overlap. */ boolean isOverLaped(Date start1,Date end1,Date start2,Date end2) throws NullPointerException{ if ((start1.before(start2) && end1.after(start2)) || (start1.before(end2) && end1.after(end2)) … Continue reading

Posted in Java | Tagged , , | 8 Comments