|
@@ -547,6 +547,38 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
|
|
|
return userPlanVo;
|
|
|
}
|
|
|
|
|
|
+ public static void main(String[] args) throws ParseException {
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(new Date(1641225600*1000));
|
|
|
+
|
|
|
+ //设置为1号,当前日期既为本月第一天
|
|
|
+ c.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
+ //将小时至0
|
|
|
+ c.set(Calendar.HOUR_OF_DAY, 0);
|
|
|
+ //将分钟至0
|
|
|
+ c.set(Calendar.MINUTE, 0);
|
|
|
+ //将秒至0
|
|
|
+ c.set(Calendar.SECOND,0);
|
|
|
+ //将毫秒至0
|
|
|
+ c.set(Calendar.MILLISECOND, 0);
|
|
|
+
|
|
|
+ Calendar c1 = Calendar.getInstance();
|
|
|
+ c1.setTime(new Date(1643817600*1000));
|
|
|
+ //设置为当月最后一天
|
|
|
+ c1.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH));
|
|
|
+ //将小时至23
|
|
|
+ c1.set(Calendar.HOUR_OF_DAY, 23);
|
|
|
+ //将分钟至59
|
|
|
+ c1.set(Calendar.MINUTE, 59);
|
|
|
+ //将秒至59
|
|
|
+ c1.set(Calendar.SECOND,59);
|
|
|
+ //将毫秒至999
|
|
|
+ c1.set(Calendar.MILLISECOND, 999);
|
|
|
+
|
|
|
+ List<CalendarStudyVo> clCalendarStudyVos = findDates(c.getTimeInMillis()/1000,c1.getTimeInMillis()/1000);
|
|
|
+ System.out.println(clCalendarStudyVos);
|
|
|
+ }
|
|
|
+
|
|
|
//获得日历
|
|
|
public static List<CalendarStudyVo> findDates(Long dBegin, Long dEnd) throws ParseException, java.text.ParseException {
|
|
|
Long timeStamp = System.currentTimeMillis(); //获取当前时间戳
|