Skip to content

Commit

Permalink
add datetime test
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923882 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pjfanning committed Feb 17, 2025
1 parent 5b12033 commit 9e64e02
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

}
}

Expand Down

0 comments on commit 9e64e02

Please sign in to comment.