From 6075751d04e1a3ec81f581c7df2b29562472c7ad Mon Sep 17 00:00:00 2001 From: zyyang Date: Tue, 22 Dec 2020 11:34:31 +0800 Subject: [PATCH] change --- .../main/java/com/taosdata/taosdemo/TaosDemoApplication.java | 2 +- .../java/com/taosdata/taosdemo/utils/TimeStampUtilTest.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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 30800244d6..0700675fa8 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 628594c4b1..4e5a1a1492 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); -- GitLab