//设置默认最近同步时间为2020-01-01
LocalDateTime localDateTime = LocalDateTime.of(2020, 1, 1, 0, 0);
ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
lmtSynRec.setLatestDate(Date.from(zonedDateTime.toInstant()));
of方法
public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute) {
LocalDate date = LocalDate.of(year, month, dayOfMonth);
LocalTime time = LocalTime.of(hour, minute);
return new LocalDateTime(date, time);