How many days are in the current month and the current day of the week to get the date

String str = "2020年08月08日";

SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");

Date date = sdf.parse(str);

Calendar instance = Calendar.getInstance();

System.out.println(instance.getActualMaximum(Calendar.DATE));

System.out.println(instance.get(Calendar.DAY_OF_WEEK)-1);

Guess you like

Origin blog.csdn.net/qq_39839828/article/details/108298140