代码
protected Date adustOffSetDate(Date useDate, int BEGIN_DATE_OFFSET) {

if(useDate == null){
return null;
}

Calendar calendar
= Calendar.getInstance();
calendar.setTime(useDate);

int volatilityNum = BEGIN_DATE_OFFSET >= 0 ? 1 : -1;

for (int i = 0; i < Math.abs(BEGIN_DATE_OFFSET); i++) {

calendar.add(Calendar.DATE, volatilityNum);
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);

if (Calendar.SATURDAY == dayOfWeek || Calendar.SUNDAY == dayOfWeek) {
i
--;
}
}

return calendar.getTime();

}

 

相关文章:

  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2021-11-14
猜你喜欢
  • 2021-06-18
  • 2021-08-18
  • 2021-10-07
  • 2021-09-12
  • 2021-07-28
  • 2021-09-20
  • 2021-10-05
相关资源
相似解决方案