标签:gettime 日期时间 获取 date pre __name__ timestamp image name
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 获取整点时间戳,半整点时间戳 ,同时将时间戳转换成 日期时间
标签:gettime 日期时间 获取 date pre __name__ timestamp image name
原文地址:https://www.cnblogs.com/ruiy/p/9591477.html