From 9ed220fd759593d8984ba5cfecdeaac670059117 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 25 Nov 2021 12:49:21 +0000 Subject: [PATCH] [bug-65703] new DataFormatter method: setUse4DigitYearsInAllDateFormats - defaults to false git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895327 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/examples/xssf/eventusermodel/XLSX2CSV.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/XLSX2CSV.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/XLSX2CSV.java index 77a1b113e8..84885b48d3 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/XLSX2CSV.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/XLSX2CSV.java @@ -201,7 +201,9 @@ public class XLSX2CSV { SharedStrings strings, SheetContentsHandler sheetHandler, InputStream sheetInputStream) throws IOException, SAXException { - //set emulateCSV=true on DataFormatter - it is also possible to provide a Locale + // set emulateCSV=true on DataFormatter - it is also possible to provide a Locale + // when POI 5.2.0 is released, you can call formatter.setUse4DigitYearsInAllDateFormats(true) + // to ensure all dates are formatted with 4 digit years DataFormatter formatter = new DataFormatter(true); InputSource sheetSource = new InputSource(sheetInputStream); try { -- 2.39.5