public static Date getNextDay(Date d, int i) {
Calendar startTime = Calendar.getInstance();
startTime.setTime(d);
startTime.set(Calendar.HOUR_OF_DAY, 0);
startTime.set(Calendar.MINUTE, 0);
startTime.set(Calendar.SECOND, 0);
startTime.set(Calendar.MILLISECOND, 0);
startTime.add(Calendar.DAY_OF_MONTH, i);
return startTime.getTime();
}
Java 给定日期加多少天
最新推荐文章于 2024-01-24 23:45:59 发布