File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Is Date Between Two Dates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is Date Between Two Dates" Watch "Is Date Between Two Dates" New topic

Is Date Between Two Dates

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1488
I have searched the web and have not found a good way to check and see if a given date is equal to or between two dates. Please help.
Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
Did you look at the Date class ?

Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
You'll have to write it.
I'd suggest Calendar over Date, but either will do.

If the time of day for your Date/Calendar is set to zero, then it is of course a trivial exercise.

Try it, let us know how it goes.

Bill Shirley - bshirley -
if (Posts < 30) JavaRanchFAQ);
I agree. Here's the link:
subject: Is Date Between Two Dates