From 29de303e0a99e29ad4332d51cd5cf17d6ba5e7b4 Mon Sep 17 00:00:00 2001 From: Da Zhou Date: Tue, 22 Jan 2019 16:41:33 +0000 Subject: [PATCH] HADOOP-16048. ABFS: Fix Date format parser. Contributed by Da Zhou. (cherry picked from commit 00ad9e23e88d1e1b1f887b6c9473a7a924a95a97) --- .../apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java index 2a058c78179..5c28bd47456 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/AzureBlobFileSystemStore.java @@ -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);