// 获取当前系统时间:2021-08-12T16:00 LocalDate localDate = LocalDate.now(); LocalDateTime dateTime = LocalDateTime.of(localDate, LocalTime.MIN).minusHours(2); //前一天12点前两小时:2021-08-11T22:00 System.out.println(dateTime);