diff --git a/tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/TaosDemoApplication.java b/tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/TaosDemoApplication.java index 30800244d6d491778de606ae21e475417ed6ef1f..0700675fa80c62f9cd44c61eb2a510fb0e7ab7d1 100644 --- a/tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/TaosDemoApplication.java +++ b/tests/examples/JDBC/taosdemo/src/main/java/com/taosdata/taosdemo/TaosDemoApplication.java @@ -100,7 +100,7 @@ public class TaosDemoApplication { private static long getProperStartTime(long startTime, int keep) { Instant now = Instant.now(); - long earliest = now.minus(Duration.ofDays(keep+1)).toEpochMilli(); + long earliest = now.minus(Duration.ofDays(keep-1)).toEpochMilli(); if (startTime == 0 || startTime < earliest) { startTime = earliest; } diff --git a/tests/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java b/tests/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java index 628594c4b18008fd9e278bb6d23d0d5f87489b56..4e5a1a149229080726a165e6cf716baebac12aea 100644 --- a/tests/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java +++ b/tests/examples/JDBC/taosdemo/src/test/java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java @@ -17,6 +17,8 @@ public class TimeStampUtilTest { @Test public void longToDatetime() { + System.out.println(TimeStampUtil.longToDatetime(1293161600069l)); + String datetime = TimeStampUtil.longToDatetime(1510000000000L); assertEquals("2017-11-07 04:26:40.000", datetime); long timestamp = TimeStampUtil.datetimeToLong(datetime);