From a1c047552cfa6dab3cef337fc0efaaed452fffa1 Mon Sep 17 00:00:00 2001 From: Tim Allison Date: Fri, 28 Oct 2016 14:11:52 +0000 Subject: 60315 -- allow 'yyyy-MM-dd' as a valid date format in metadata in OPCParser git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1767026 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ooxml/java/org/apache/poi/openxml4j') diff --git a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java index b8091973e9..6fb7f65be8 100644 --- a/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java +++ b/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java @@ -55,6 +55,7 @@ public final class PackagePropertiesPart extends PackagePart implements private final static String[] DATE_FORMATS = new String[]{ DEFAULT_DATEFORMAT, "yyyy-MM-dd'T'HH:mm:ss.SS'Z'", + "yyyy-MM-dd" }; //Had to add this and TIME_ZONE_PAT to handle tz with colons. @@ -635,7 +636,7 @@ public final class PackagePropertiesPart extends PackagePart implements if (date == null) { return ""; } - + SimpleDateFormat df = new SimpleDateFormat(DEFAULT_DATEFORMAT, Locale.ROOT); df.setTimeZone(LocaleUtil.TIMEZONE_UTC); return df.format(date); -- cgit v1.2.3