本类依赖commons-lang包
java日期计算简单实用方法如下:
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
WorkdayUtils workdayUtils = new WorkdayUtils(); workdayUtils.setLegalWorkdayList(legalWorkdayList);
workdayUtils.setLegalHolidayList(legalHolidayList);
//计算15个工作日之后的工作日日期
Date date = workdayUtils.getWorkday(new Date(), 15);
//计算两个日期之间的工作日总数
int count = workdayUtils.getWorkdayCount(new Date(), format.parse("2013-08-13"));
2021-09-03 10:36:34
257KB
java
1