// Date and time2. Local . . of to create objects. // Difference between two times - Less than 24 hours import java.time.*; public class DateAndTime5 { public static void main (String[]args) { // Declare outside the try ... catch LocalTime lt1 = null, lt2 = null; try { // Less than 24 hours for class Duration arguements lt1 = LocalTime.of(23, 14, 3); lt2 = LocalTime.of(9, 3, 56); } catch (DateTimeException ex) { System.out.println("Error with date and time"); } // end catch System.out.println(lt1); System.out.println(lt2); Duration diff = Duration.between(lt2, lt1); System.out.println(diff); } // end main }// end class ==================================================================== OUTPUT -hours, minutes and seconds ----jGRASP exec: java DateAndTime5 23:14:03 09:03:56 PT14H10M7S ----jGRASP: operation complete.