// Date and time2. Local . . of to create objects. // Difference between two dates - More than 24 hours import java.time.*; public class DateAndTime6 { public static void main (String[]args) { // Declare outside the try ... catch LocalDate dob = null, today = null; try { // More than 24 hours for class Period arguements dob = LocalDate.of(1956, 3, 11); today = LocalDate.now(); } catch (DateTimeException ex) { System.out.println("Error with date and time"); } // end catch System.out.println(dob); System.out.println(today); Period diff = Period.between(dob, today); System.out.println(diff); int years = diff.getYears(); int months = diff.getMonths(); int days = diff.getDays(); System.out.print("Years:" + years + " Months:" + months + " Days:" + days); } // end main }// end class ======================================================================= OUTPUT - Difference in years, months and dats ----jGRASP exec: java DateAndTime6 1956-03-11 2021-05-30 P65Y2M19D Years:65 Months:2 Days:19 ----jGRASP: operation complete.