Commit de005920 by huangjy

fix:添加缓存

parent e4cc559e
......@@ -20,7 +20,6 @@ import com.makeit.utils.LongTimestampUtil;
import com.makeit.utils.data.convert.JsonUtil;
import com.makeit.utils.data.convert.StreamUtil;
import com.makeit.utils.old.StringUtils;
import com.sun.jmx.snmp.Timestamp;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.RandomUtils;
......@@ -192,6 +191,16 @@ public class IotProductDeviceService extends IotCommonService {
return breatheList;
}
public static void main(String[] args) {
LocalDateTime localDateTime = LocalDateTime.now();
long timeStamp = localDateTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli();
System.out.println(timeStamp);
long timestamp = localDateTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
System.out.println("LocalDateTime to Timestamp: " + timestamp);
}
public static String formatLongTime(long time) {
return DEFAULT_FORMATTER.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time), ZoneId.systemDefault()));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment