add volitile

This commit is contained in:
Looly
2020-11-26 13:58:26 +08:00
parent 994a7a49bf
commit 4cc276e665
5 changed files with 21 additions and 19 deletions

View File

@@ -819,10 +819,10 @@ public class DateUtil extends CalendarUtil {
int length = utcString.length();
if (StrUtil.contains(utcString, 'Z')) {
if (length == DatePattern.UTC_PATTERN.length() - 4) {
// 格式类似2018-09-13T05:34:31Z
// 格式类似2018-09-13T05:34:31Z-4表示减去4个单引号的长度
return parse(utcString, DatePattern.UTC_FORMAT);
} else if (length == DatePattern.UTC_MS_PATTERN.length() - 4) {
// 格式类似2018-09-13T05:34:31.999Z
// 格式类似2018-09-13T05:34:31.999Z-4表示减去4个单引号的长度
return parse(utcString, DatePattern.UTC_MS_FORMAT);
}
} else {