change
This commit is contained in:
parent
fd8fa36dd7
commit
6075751d04
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue