aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-04-25 17:16:05 +0000
committerPJ Fanning <fanningpj@apache.org>2021-04-25 17:16:05 +0000
commit50cfe3c10ed4dbee2d9b066d78e5fedf01921e4e (patch)
tree92a0c9069189af5db8457ce46eb697494018fa02 /poi-ooxml
parent1d594451d8b0ebee8f771aae1b59080e46c982a0 (diff)
downloadpoi-50cfe3c10ed4dbee2d9b066d78e5fedf01921e4e.tar.gz
poi-50cfe3c10ed4dbee2d9b066d78e5fedf01921e4e.zip
[github-235] Fix date formatting for number cell values. Thanks to Anthony Schott. This close #235
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1889179 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/ss/tests/format/TestCellFormatPart.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/format/TestCellFormatPart.java b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/format/TestCellFormatPart.java
index 8514542080..e49021f578 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/ss/tests/format/TestCellFormatPart.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/ss/tests/format/TestCellFormatPart.java
@@ -136,6 +136,17 @@ class TestCellFormatPart {
}
@Test
+ void testDateFormatNumbers() throws IOException {
+ TimeZone tz = LocaleUtil.getUserTimeZone();
+ LocaleUtil.setUserTimeZone(TimeZone.getTimeZone("CET"));
+ try {
+ runFormatTests("DateFormatNumberTests.xlsx", Cell::getNumericCellValue);
+ } finally {
+ LocaleUtil.setUserTimeZone(tz);
+ }
+ }
+
+ @Test
void testElapsedFormat() throws IOException {
runFormatTests("ElapsedFormatTests.xlsx", Cell::getNumericCellValue);
}