获取日期方法
SimpleDateFormat format = new SimpleDateFormat("YYYY-MM-dd");
Calendar now = Calendar.getInstance();
//获取当前年份
int year = now.get(Calendar.YEAR);
//获取当前月份
int month = (now.get(Calendar.MONTH) + 1);
//获取当天日期
int day = now.get(Calendar.DAY_OF_MONTH);
//当前时间的周一日期
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
String weekStart = format.format(c.getTime());
int weekStartYear = Integer.parseInt(weekStart.split("-")[0]);
int weekStartMonth = Integer.parseInt(weekStart.split("-")[1]);
int weekStartDay = Integer.parseInt(weekStart.split("-")[2]);
//当前时间的周日日期
Calendar ca = Calendar.getInstance();
ca.setFirstDayOfWeek(Calendar.MONDAY);
ca.set(Calendar.DAY_OF_WEEK, ca.getFirstDayOfWeek() + 6); // Sunday
String weekEnd = format.format(ca.getTime());
int weekEndYear = Integer.parseInt(weekEnd.split("-")[0]);
int weekEndMonth = Integer.parseInt(weekEnd.split("-")[1]);
int weekEndDay = Integer.parseInt(weekEnd.split("-")[2]);