LocalDateTime date1 = LocalDateTime.of(2022, 1, 10, 12, 30);
LocalDateTime date2 = LocalDateTime.of(2022, 1, 11, 15, 20);
LocalDateTime max = date1.compareTo(date2) > 0 ? date1 : date2;
System.out.println(max);
注意:本文归作者所有,未经作者允许,不得转载
LocalDateTime date1 = LocalDateTime.of(2022, 1, 10, 12, 30);
LocalDateTime date2 = LocalDateTime.of(2022, 1, 11, 15, 20);
LocalDateTime max = date1.compareTo(date2) > 0 ? date1 : date2;
System.out.println(max);
注意:本文归作者所有,未经作者允许,不得转载