Python 获取当前时间的时间戳

秒级

import time

now = time.time() #返回float数据
#  获取当前时间戳---秒级级
print(int(now))

毫秒级

import time

now = time.time() #返回float数据

#毫秒级时间戳
print(int(round(now * 1000)))

时间戳在线转换工具:

https://tool.lu/timestamp/

原文地址:https://www.cnblogs.com/eosclover/p/14201849.html