环境1:emqx开源版(docker)+mqttx+python3接入,docker中date正常
环境2:emqx_cloud+在线调试+python3接入
在这2个环境里,python接入的订阅到消息中的timestamp都很小,
def on_message(client, userdata, msg):
timestamp = msg.timestamp
print(f’timestamp: {timestamp}')
print(time.strftime(“%Y-%m-%d %H:%M:%S”,time.localtime(timestamp)))
输出:
timestamp: 87686.546
1970-01-02 08:21:26
不知道是否正常,timestamp事件触发时间 (ms)是以什么为起点的呢