Java Check If Date Is Within Date Range

I made this method in order for me to determine if a java.util.Date falls in between 2 java.util.Date objects. I used Calendar objects to wrap the Date objects as they are much easier to use and retrieve month, day and year infos. Another helper method called isDateEqual is used within the isWithinDateRange method to determine if both Date objects are equal (excluding the time).

Related Posts Plugin for WordPress, Blogger...

1 comment

  1. recontribution:

    return !(dateToSearch.before(startdate) || dateToSearch.after(enddate));

    and you can remove the last method

Leave a Reply

Your email address will not be published. Required fields are marked *