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)
如果大神们有更好的写法,还望不吝赐教。
时间: 2025-01-31 09:19:58