From 3309d1f82027768a442a54c2f1442e8a678fd5bc Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Fri, 4 Dec 2015 10:51:03 +0000 Subject: [PATCH] make fields static git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1717929 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/usermodel/ExcelStyleDateFormatter.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java b/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java index c075b55b24..2ea273f951 100644 --- a/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java +++ b/src/java/org/apache/poi/ss/usermodel/ExcelStyleDateFormatter.java @@ -43,13 +43,13 @@ public class ExcelStyleDateFormatter extends SimpleDateFormat { public static final char L_BRACKET_SYMBOL = '\ue016'; public static final char LL_BRACKET_SYMBOL = '\ue017'; - private final DecimalFormat format1digit; - private final DecimalFormat format2digits; + private static final DecimalFormat format1digit; + private static final DecimalFormat format2digits; - private final DecimalFormat format3digit; - private final DecimalFormat format4digits; + private static final DecimalFormat format3digit; + private static final DecimalFormat format4digits; - { + static { DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(Locale.ROOT); format1digit = new DecimalFormat("0", dfs); format2digits = new DecimalFormat("00", dfs); @@ -59,6 +59,9 @@ public class ExcelStyleDateFormatter extends SimpleDateFormat { DataFormatter.setExcelStyleRoundingMode(format2digits, RoundingMode.DOWN); DataFormatter.setExcelStyleRoundingMode(format3digit); DataFormatter.setExcelStyleRoundingMode(format4digits); + } + + { setTimeZone(LocaleUtil.getUserTimeZone()); } -- 2.39.5