HADOOP-16048. ABFS: Fix Date format parser.

Contributed by Da Zhou.

(cherry picked from commit 00ad9e23e8)
This commit is contained in:
Da Zhou 2019-01-22 16:41:33 +00:00 committed by Steve Loughran
parent 8dd8121f7d
commit 29de303e0a
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 2 additions and 1 deletions

View File

@ -40,6 +40,7 @@ import java.util.HashMap;
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 @@ public class AzureBlobFileSystemStore {
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);