public static Date getTime(int day){
// 获取当前时间
Date date = new Date();
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
// 把日期往后增加天数,整数 往后推,负数往前移动
calendar.add(Calendar.DATE, day);
// 返回结果
return calendar.getTime();
}
为当前时间增加天数
最新推荐文章于 2024-05-06 18:26:10 发布