Calendar的使用举个小栗子:
//通过当前时间获取本周周一时间
Date date = new Date();
Calendar calendar = new GregorianCalendar();
calendar.setTime(date );
calendar.add(Calendar.DATE,i + 1 - (calendar.get(Calendar.DAY_OF_WEEK) - 1) );
date = calendar.getTime();
2023-12-10 22:53:21
Calendar的使用举个小栗子:
//通过当前时间获取本周周一时间
Date date = new Date();
Calendar calendar = new GregorianCalendar();
calendar.setTime(date );
calendar.add(Calendar.DATE,i + 1 - (calendar.get(Calendar.DAY_OF_WEEK) - 1) );
date = calendar.getTime();