Using Joda Time you could do something like this:
DateTime start = new DateTime(2010, 5, 25, 12, 0, 0, 0);
DateTime end = new DateTime(2010, 5, 25, 21, 0, 0, 0);
Interval interval = new Interval(start, end);
DateTime test = new DateTime(2010, 5, 25, 16, 0, 0, 0);
System.out.println(interval.contains(test));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…