////////// 获取本周的开始日期和结束日期 ////////////////
Date dt = new Date();
int this_day = dt.getDay();
// 如果周日作为一周的最后一天
int step_s2 = -this_day+1; // 上周日距离今天的天数(负数表示)
if (this_day == 0) {
step_s2 = -7; // 如果今天是周日
}
int step_m2 = 7 - this_day; // 周日距离今天的天数(负数表示)
long thisTime = System.currentTimeMillis();
Date monday = new Date(thisTime + (long) step_s2 * 24 * 3600
* 1000);
Date sunday = new Date(thisTime + (long) step_m2 * 24 * 3600
* 1000);
Format format = new SimpleDateFormat("yyyy-MM-dd");