标签:好的 log nbsp start.s ptime style start print int
import time import datetime today = datetime.datetime.now() # delta = datetime.timedelta(hours=1) delta = datetime.timedelta(days=7) start = today - delta dt = start.strftime("%Y-%m-%d %H:%M:%S") timeArray = time.strptime(dt, "%Y-%m-%d %H:%M:%S") startts = int(time.mktime(timeArray)) * 1000000 print(startts)
如果大神们有更好的写法,还望不吝赐教。
标签:好的 log nbsp start.s ptime style start print int
原文地址:http://www.cnblogs.com/zhzhang/p/7434843.html