long currentTime = System.currentTimeMillis() +想要增加的时间毫秒数;

Date date = new Date(currentTime);

 

 

增加整数N天的话

import org.apache.commons.lang3.time.DateUtils;

Date now = new Date();
Date startDate = DateUtils.addDays(now, 30);

上面表示往后30天,-30就是往前三十天

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案