先獲取,再格式化 ;
LocalDateTime of = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
System.out.println( of.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
LocalDateTime max = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
System.out.println(max.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
或者
LocalDateTime.of(LocalDate.now(),LocalTime.of(0,0,0,0))
LocalDateTime.of(LocalDate.now(),LocalTime.of(23,59,59))