python time 生成13位时间戳

废话不多说,直接上代码

import time
un_time = time.mktime(result.timetuple()) # 输出的结果:result->datetime.datetime(2020, 11, 4, 15, 12, 45)
un_time = int(round(un_time)*1000) # 输出的结果:un_time->1604473965000

你可能感兴趣的:(Python,python)