java 获取当前周的周一和周日的日期
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 Calendar cld = Calendar.getInstance(Locale.CHINA); cld.setFirstDayOfWeek(Calendar.MONDAY);//以周一为首日 cld.setTimeInMillis(System.currentTimeMillis());//当前时间 cld.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);//周一 System.out.println(df.format(cld.getTime())); cld.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);//周日 System.out.println(df.format(cld.getTime()));