import datetime, time
now = datetime.datetime.now()
now_time = int(time.mktime(now.timetuple())) #datetime 转时间戳
now = datetime.datetime.fromtimestamp(now_time) #时间戳转datetime
# datetime 当天8点
datetime(now.year, now.month, now.day, 8)
now = 0点-8点 int(now-now % 86400) + time.timezone是前一天的零点