Calendar calendar = Calendar.getInstance();
int week = calendar.get(Calendar.DAY_OF_WEEK);// 当前星期几
int days = calendar.get(Calendar.DAY_OF_MONTH);// 当前日期
for (int i = 0; i < 100 * 7; i++) {
calendar.add(Calendar.DAY_OF_YEAR, -1);
if (calendar.get(Calendar.DAY_OF_WEEK) == week
&& calendar.get(Calendar.DAY_OF_MONTH) == days) {
System.out.println(calendar.get(Calendar.YEAR) + ":"
+ (calendar.get(Calendar.MONTH) + 1) + ":"
+ calendar.get(Calendar.DAY_OF_MONTH));
}
}
}
学习了