提交 6075751d 编写于 作者: Z zyyang

change

上级 fd8fa36d
...@@ -100,7 +100,7 @@ public class TaosDemoApplication { ...@@ -100,7 +100,7 @@ public class TaosDemoApplication {
private static long getProperStartTime(long startTime, int keep) { private static long getProperStartTime(long startTime, int keep) {
Instant now = Instant.now(); 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) { if (startTime == 0 || startTime < earliest) {
startTime = earliest; startTime = earliest;
} }
......
...@@ -17,6 +17,8 @@ public class TimeStampUtilTest { ...@@ -17,6 +17,8 @@ public class TimeStampUtilTest {
@Test @Test
public void longToDatetime() { public void longToDatetime() {
System.out.println(TimeStampUtil.longToDatetime(1293161600069l));
String datetime = TimeStampUtil.longToDatetime(1510000000000L); String datetime = TimeStampUtil.longToDatetime(1510000000000L);
assertEquals("2017-11-07 04:26:40.000", datetime); assertEquals("2017-11-07 04:26:40.000", datetime);
long timestamp = TimeStampUtil.datetimeToLong(datetime); long timestamp = TimeStampUtil.datetimeToLong(datetime);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册