直接上代码
import time
#当前时间的时间戳,含有浮点数,例如:1642494111087.914
a = time.time() * 1000
#当前时间的时间戳,不含浮点数,13位,例如:1642494111088
b = int( round( time.time() * 1000) )
#当前时间的时间戳,不含浮点数,10位,例如:1642494111
c = int( time.time() )
#当天时间零点时间戳,13位,例如:1642435200893
d = int( round(time.time() * 1000)) - int(int(time.time() - time.timezone) % 86400)*1000
#当天时间零点时间戳,10位,例如:1642435200
e = int(time.time())- (int(time.time())- time.timezone)%86400
对代码要求不高的话拿过去直接用就可以了
本文提供了一种使用Python生成当前时间及当天零点不同精度时间戳的方法,包括13位和10位的时间戳,并提供了具体的实现代码。
&spm=1001.2101.3001.5002&articleId=122562400&d=1&t=3&u=f94f59d848874980b1328228808565f9)
1325

被折叠的 条评论
为什么被折叠?



