doum
2 天以前 46e8af542c02d801bea9fa8cf8f55974dcfa8554
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -92,10 +92,11 @@
        Date nowAsISO = null;
        try {
            nowAsISO = df.parse(date);
        } catch (ParseException e) {
        } catch (Exception e) {
        }
        return nowAsISO;
    }
    public static Date getISO8601DateByStr2(String date)  {
        TimeZone tz = TimeZone.getTimeZone("Asia/Shanghai");
        if(date!=null ){
@@ -111,7 +112,7 @@
        Date nowAsISO = null;
        try {
            nowAsISO = df.parse(date);
        } catch (ParseException e) {
        } catch (Exception e) {
        }
        return nowAsISO;
    }
@@ -2967,49 +2968,7 @@
    public static void main(String[] args) {
        try {
            LocalDate today = LocalDate.now();
            // 获取当前日期是星期几
            DayOfWeek dayOfWeek = today.getDayOfWeek();
            // 计算周一和周五的日期
            LocalDate monday = today.with(DayOfWeek.MONDAY);
            LocalDate friday = today.with(DayOfWeek.FRIDAY);
            // 输出周一和周五的日期
            System.out.println("Monday: " + monday.toString());
            System.out.println("Friday: " + friday.toString());
//            Date date = getISO8601DateByStr("2024-04-15T07:46:36.014+08:00");
//            Date date1 = getISO8601DateByStr("2024-06-14T08:46:36.014+08:00");
//            System.out.println(DateUtil.afterMinutesDate(-5));
//            System.out.println(DateUtil.getWeekZhouOfDate(getDateFromString2("2025-11-06 00:00:00")));
//            System.out.println(getPlusTime2(DateUtil.addMonthToDate(new Date(),-1)));
//            System.out.println(DateUtil.getBeforMonthStr(new Date(),12));
//            List<Date> list =getThisMonthDateList();
//            for(Date d :list){
//                System.out.println(getPlusTime2(d));
//            }
//            List<Date> list1 =getThisYearMonthList();
//            for(Date d :list1){
//                System.out.println(getPlusTime2(d));
//            }
//            Date startTime = DateUtil.StringToDate("2024-05-01 08:00:00" ,"yyyy-MM-dd HH:mm:ss");
//            Date endTime = DateUtil.StringToDate("2024-05-01 17:00:00" ,"yyyy-MM-dd HH:mm:ss");
//            Long intervalTime = 35L;
//
//
//            DateUtil.checkDateInterval( startTime.toInstant()
//                    .atZone(ZoneId.systemDefault())
//                    .toLocalDateTime(), endTime.toInstant()
//                    .atZone(ZoneId.systemDefault())
//                    .toLocalDateTime(),intervalTime);
        System.out.println(getISO8601DateByStr("2025-12-26T03:08:39.123Z"));
        } catch (Exception ex) {
            ex.printStackTrace();
        }