I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range.
Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode:
boolean isWithinRange(Date testDate) {
return testDate >= startDate && testDate <= endDate;
}
Not sure if it's relevant, but the dates I'm pulling from the database have timestamps.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…