Explorar o código

优化日期转换逻辑

woody hai 8 meses
pai
achega
b4ef67cb7b

+ 2 - 2
framework-common/src/main/java/com/chelvc/framework/common/util/DateUtils.java

@@ -113,8 +113,8 @@ public final class DateUtils {
                     StringUtils.getPattern("^\\d{4}/\\d{1,2}/\\d{1,2} \\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{1,3}$"),
                     new DatetimeParser(DateTimeFormatter.ofPattern("yyyy-M-d H:m:s.SSS"))
             ).put(
-                    StringUtils.getPattern("^\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{1,3}Z$"),
-                    new DatetimeParser(DateTimeFormatter.ofPattern("yyyy-M-d'T'H:m:s.SSS'Z'"))
+                    StringUtils.getPattern("^\\d{4}-\\d{1,2}-\\d{1,2}T\\d{1,2}:\\d{1,2}:\\d{1,2}\\.\\d{1,3}\\S+$"),
+                    new DatetimeParser(DateTimeFormatter.ofPattern("yyyy-M-d'T'H:m:s.SSSXXX"))
             ).put(
                     StringUtils.getPattern(
                             "^[a-zA-Z]{3} [a-zA-Z]{3} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} CST [0-9]{4}$"