import time
import can
def ReceiveMsg():
bus = can.interface.Bus(channel= '1', bustype='vector',app_name = 'python-can')
while True:
a_listener = can.Listener()
Message = bus.recv()
a_listener.on_message_received(Message)
if (Message != None) & (Message.arbitration_id == 0x329):
print('Message is :',Message)
return Message
if __name__ == '__main__':
ReceiveMsg()
如果我执行我会得到低于输出
Message is : Timestamp: 1559297416.090523 ID: 0329 S DLC: 8 ca 00 03 28 00 00 00 00 Channel: 1
1559297416.090523
- 这是 Python 时间戳
在输出 Timestamp: 是给 Python 时间
如何将 Python 时间转换为系统时间???