mport java.text.SimpleDateFormat;
import java.util.Calendar;
public class Test{
public static void main(String args[]){
Calendar cal = Calendar.getInstance();
//n为推迟的周数,1本周,-1向前推迟一周,2下周,依次类推
int n = 2;
String monday;
cal.add(Calendar.DATE, n*7);
//想周几,这里就传几Calendar.MONDAY(TUESDAY...)
cal.set(Calendar.DAY_OF_WEEK,Calendar.MONDAY);
monday = new SimpleDateFormat("yyyy-MM-dd").format(cal.getTime());
System.out.println(monday);
}
}
查看java api 日历类的帮助文档