MrShi
5 天以前 3b759ef71bb48f9bb6f8445770d20e8ea7921788
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,35 +2968,7 @@
    public static void main(String[] args) {
        try {
//            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();
        }