public static void main(String[] args) {
Date date= nextDate(new Date());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(date));
}
public static Date nextDate(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.DAY_OF_MONTH, +1);// 时间+1天
Date nextDate = calendar.getTime();
return nextDate;
}
在日期数据上加一天
最新推荐文章于 2024-04-16 10:41:35 发布