This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 1393
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: 3432
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
Similar Threads
Calculate number of days between two dates
Generating a list of dates from a range
how do I find date difference in months
Displaying tha Date between two dates in paint method...
Extracting months from Date object data