随笔 - 29  文章 - 0  评论 - 0  阅读 - 43947 

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   米兔斯基  阅读(202)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示