import time,datetime
def gettime():
for x in range(24):
a = datetime.datetime.now().strftime("%Y-%m-%d")+" %2d:00:00"%x
timeArray = time.strptime(a, "%Y-%m-%d %H:%M:%S")
timeStamp = int(time.mktime(timeArray))
print(timeStamp)
if __name__ == "__main__":
gettime()
python 获取当天每个准点时间戳
最新推荐文章于 2022-06-17 14:11:50 发布