From db5ae74a2b9822c1008f42dce7fc462f2411aaf3 Mon Sep 17 00:00:00 2001 From: John DeRegnaucourt Date: Mon, 12 Feb 2024 21:39:43 -0500 Subject: [PATCH] Fixed Date conversion issues. --- .../util/convert/ConverterEverythingTest.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java index 5cfabae6..20388945 100644 --- a/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java +++ b/src/test/java/com/cedarsoftware/util/convert/ConverterEverythingTest.java @@ -796,15 +796,15 @@ public TimeZone getTimeZone() { }); TEST_DB.put(pair(LocalDate.class, Long.class), new Object[][] { { (Supplier) () -> { - ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:01"); + ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00"); return zdt.toLocalDate(); - }, 1707714000000L }, // Epoch millis in Tokyo timezone (at start of day - no time) + }, 1707663600000L }, // Epoch millis in Tokyo timezone (at start of day - no time) }); TEST_DB.put(pair(LocalDateTime.class, Long.class), new Object[][] { { (Supplier) () -> { - ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:01"); + ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00"); return zdt.toLocalDateTime(); - }, 1707755880000L }, // Epoch millis in Tokyo timezone + }, 1707705480000L }, // Epoch millis in Tokyo timezone }); TEST_DB.put(pair(ZonedDateTime.class, Long.class), new Object[][] { { ZonedDateTime.parse("2024-02-12T11:38:00+01:00"), 1707734280000L }, @@ -1045,15 +1045,15 @@ public TimeZone getTimeZone() { }); TEST_DB.put(pair(LocalDate.class, Double.class), new Object[][] { { (Supplier) () -> { - ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:01"); + ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00"); return zdt.toLocalDate(); - }, 1707714000000d }, // Epoch millis in Tokyo timezone (at start of day - no time) + }, 1707663600000d }, // Epoch millis in Tokyo timezone (at start of day - no time) }); TEST_DB.put(pair(LocalDateTime.class, Double.class), new Object[][] { { (Supplier) () -> { - ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:01"); + ZonedDateTime zdt = ZonedDateTime.parse("2024-02-12T11:38:00+01:00"); return zdt.toLocalDateTime(); - }, 1707755880000d }, // Epoch millis in Tokyo timezone + }, 1707705480000d }, // Epoch millis in Tokyo timezone }); TEST_DB.put(pair(ZonedDateTime.class, Double.class), new Object[][] { { ZonedDateTime.parse("2024-02-12T11:38:00+01:00"), 1707734280000d }, @@ -1690,7 +1690,7 @@ void testConvert(String shortNameSource, String shortNameTarget, Object source, try { assertEquals(target, actual); } catch (Throwable e) { - System.err.println(shortNameSource + "[" + source + "] ==> " + shortNameTarget + "[" + target + "] Failed"); + System.err.println(shortNameSource + "[" + source + "] ==> " + shortNameTarget + "[" + target + "] Failed with: " + actual); throw e; } }