Here you can find the source of getBetweenWorkDate(int amount, Date beginDate)
public static Date getBetweenWorkDate(int amount, Date beginDate)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static Date getBetweenWorkDate(int amount, Date beginDate) { int addDate = 0; for (int ii = 1; ii <= amount; ii++) { Calendar cal2 = Calendar.getInstance(); cal2.setTime(beginDate);//from w w w .j a va 2 s . co m cal2.add(Calendar.DATE, ii); int week = cal2.get(Calendar.DAY_OF_WEEK); if (week != 1 && week != 7) { addDate++; } } Calendar cal2 = Calendar.getInstance(); cal2.setTime(beginDate); cal2.add(Calendar.DATE, addDate); return cal2.getTime(); } }