LAPTOP-KB9HII50\70708 hace 1 año
padre
commit
c5c132d868

+ 4 - 1
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -199,6 +199,9 @@ public class DateUtil {
        if (StringUtils.isEmpty(strDate)) {
            return null;
        }
        if(strDate.length()<=10&&format.length()>10){
            format = format.substring(0,strDate.length());
        }
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(format);
        LocalDate localDate = LocalDate.parse(strDate,dateTimeFormatter);
        return Date.from(localDate.atStartOfDay(zone).toInstant());
@ -862,7 +865,7 @@ public class DateUtil {
     *  字符串转时间
     */
    public static Date stringToDate(String str, String eg) {
        return strToDate(str,eg);
        return strToDate(str);
    }
    public static int getNowMonth(){