In my app I create an object that represents a high school class. This object holds 2 Calendar objects that represents the class\'s start and stop time each day. When a user c
try { Date date1 = sdf.parse(given time); Date date2 = sdf.parse("08:00 AM"); Date date3 = sdf.parse("06:00 PM"); if((date1.after(date2))&&(date1.before(date3))||date1.equals(date2) ||date1.equals(date3) ) { } } catch (ParseException e){ e.printStackTrace(); }