/**
* timeD:指定日期
* 1:获取指定日期的后面1个月
* date:最终需要的日期
*/
Date startData = new SimpleDateFormat("yyyy-MM-dd").parse(timeD);
LocalDateTime localDateTime = startData.toInstant()
.atZone(ZoneId.systemDefault())
.toLocalDateTime()
.plusMonths(1);
Date date = Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
获取指定日期的下个月
最新推荐文章于 2023-04-18 18:06:37 发布