Comparing time is incorrect when picking 12:00
问题 I am creating a booking system and I don't want to allow users to book with starting time 11:00 and end time 09:00 (past)(I am using 24hour clock). I have two combo boxes filled with Strings that act as start and end time (09:00,10:00,11:00,12:00,13:00....) I have this code: String start = (String) startTime.getSelectedItem(); String end = (String) endTime.getSelectedItem(); try { if(new SimpleDateFormat("hh:mm").parse(start).before(new SimpleDateFormat("hh:mm").parse(end))){ System.out