HADOOP-16048. ABFS: Fix Date format parser.

Contributed by Da Zhou.
This commit is contained in:
Da Zhou 2019-01-22 16:40:42 +00:00 committed by Steve Loughran
parent 6f0756fc0e
commit 00ad9e23e8
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0

View File

@ -40,6 +40,7 @@
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -845,7 +846,7 @@ private boolean parseIsDirectory(final String resourceType) {
private long parseLastModifiedTime(final String lastModifiedTime) {
long parsedTime = 0;
try {
Date utcDate = new SimpleDateFormat(DATE_TIME_PATTERN).parse(lastModifiedTime);
Date utcDate = new SimpleDateFormat(DATE_TIME_PATTERN, Locale.US).parse(lastModifiedTime);
parsedTime = utcDate.getTime();
} catch (ParseException e) {
LOG.error("Failed to parse the date {}", lastModifiedTime);