0
点赞
收藏
分享

微信扫一扫

python 生成time时间戳 (10位和13位)


1. time时间戳(10位)

import time
t = int(time.time()) # 1326428326

2. time时间戳(13位)

import time
t = round(time.time()*1000) #1694609388318

3. 对time时间戳转为为字符串

import time
t = round(time.time()*1000)
t_str = time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(t/1000))


举报

相关推荐

0 条评论