python 获取当天每个准点时间戳的实例
实例如下所示:
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()
相关推荐
xinhao 2020-02-13
zhglinux 2020-01-12
逍遥友 2019-12-08
davidchang 2019-11-04
党薇 2019-05-14
liuxiaohua 2019-04-01
kikaylee 2019-04-01
奋斗的蜗牛 2019-03-28
katnisswuyuechen 2018-12-19
codepython 2018-05-22
Triagen 2017-12-11
zongzi00 2016-01-19
liugan 2017-10-20
lispython 2016-03-23
uglygirl 2015-05-15
Triagen 2015-04-23
PythonGCS 2015-03-13