From 9e64e029e0791e323044977d492db34d111d45ce Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 17 Feb 2025 20:34:51 +0000 Subject: [PATCH] add datetime test git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923882 13f79535-47bb-0310-9956-ffa450edef68 --- .../test/java/org/apache/poi/ss/usermodel/BaseTestCell.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestCell.java b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestCell.java index 039c6aea9f3..de2c4ad7c64 100644 --- a/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestCell.java +++ b/poi/src/test/java/org/apache/poi/ss/usermodel/BaseTestCell.java @@ -33,6 +33,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.LocalDateTime; +import java.time.LocalTime; import java.time.ZoneOffset; import java.util.Calendar; import java.util.Date; @@ -1434,6 +1435,11 @@ void testZeroDate() throws IOException { // time only means cells that have values with just times but no date parts assertEquals(LocalDate.parse("1899-12-31"), cellA1.getLocalDateTimeCellValue().toLocalDate()); + + cellA1.setCellValue(0.5); + assertEquals(LocalTime.parse("12:00"), + cellA1.getLocalDateTimeCellValue().toLocalTime()); + } }