string[] arrdate = new STRING[7];
string[] Arrweek = new STRING[7];
int mondayplus = 0;
Calendar cd = Calendar.getinstance ();
Get today is the day of the week, Sunday is the first, Tuesday is the second day ...
int dayOfWeek = Cd.get (Calendar.day_of_week)-1; Because according to China Monday
if (DayOfWeek = = 1) {
Mondayplus = 0;
} else {
Mondayplus = 1-dayofweek;
}
for (int i=0; i<7; i++) {
GregorianCalendar currentdate = new GregorianCalendar ();
Currentdate.add (gregoriancalendar.date, Mondayplus + 6 + i);
Date Monday = Currentdate.gettime ();
DateFormat df = dateformat.getdateinstance ();
SimpleDateFormat df = new SimpleDateFormat ("Yyyy-mm-dd EE");
String Premonday = Df.format (Monday);
string[] Strarr = Premonday.split ("");
Storage Date
Arrdate[i] = strarr[0];
How many days to store
Arrweek[i] = strarr[1];
System.out.println (arrdate[i]+ "," +arrweek[i]);
}
2. Java get next Sunday-Next Saturday time