648540858
2024-01-19 47e5d2b00b5b13c1004f94a7ccd3f406391698a0
src/main/java/com/genersoft/iot/vmp/utils/DateUtil.java
@@ -139,4 +139,13 @@
        Instant beforeInstant = Instant.from(formatter.parse(keepaliveTime));
        return ChronoUnit.MILLIS.between(beforeInstant, Instant.now());
    }
    public static long getDifference(String startTime, String endTime) {
        if (ObjectUtils.isEmpty(startTime) || ObjectUtils.isEmpty(endTime)) {
            return 0;
        }
        Instant startInstant = Instant.from(formatter.parse(startTime));
        Instant endInstant = Instant.from(formatter.parse(endTime));
        return ChronoUnit.MILLIS.between(endInstant, startInstant);
    }
}