add method

This commit is contained in:
Looly
2021-12-22 00:48:31 +08:00
parent 6eb5a76f80
commit 8705f1b67c
4 changed files with 31 additions and 9 deletions

View File

@@ -146,8 +146,12 @@ public class LocalDateTimeUtilTest {
@Test
public void endOfDayTest() {
final LocalDateTime localDateTime = LocalDateTimeUtil.parse("2020-01-23T12:23:56");
final LocalDateTime endOfDay = LocalDateTimeUtil.endOfDay(localDateTime);
LocalDateTime endOfDay = LocalDateTimeUtil.endOfDay(localDateTime);
Assert.assertEquals("2020-01-23T23:59:59.999999999", endOfDay.toString());
endOfDay = LocalDateTimeUtil.endOfDay(localDateTime, true);
Assert.assertEquals("2020-01-23T23:59:59", endOfDay.toString());
}
@Test