LocalDate date = LocalDate.now();
LocalDate newDate = date.plus(-31, ChronoUnit.DAYS);
System.out.println("newDate=" + newDate);

 

LocalDateTime date=LocalDateTime.now();
LocalDateTime newDate = date.plus(-31, ChronoUnit.DAYS);
LocalDateTime newDate2 = newDate.plus(1, ChronoUnit.HOURS);

posted on 2019-01-31 00:19  米兔斯基  阅读(202)  评论(0编辑  收藏  举报