LocalDateTime转Date
Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
Date resultDate = Date.from(instant);
Date转LocalDateTime
LocalDateTime localDateTime = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
LocalDateTime常用操作
LocalDateTime localDateTime = dateTime.plusMonths(n).withHour(23).withMinute(59).withSecond(59).withNano(0);// 加n个月,设置23点59分59秒
LocalDateTime localDateTime = dateTime.plusMonths(n).with(TemporalAdjusters.lastDayOfMonth()).withHour(23).withMinute(59).withSecond(59).withNano(0);// 加n个月,月底那天