1. 当周星期五
import time,datetime thisfriday = str(datetime.date.today() + datetime.timedelta(days= (4 - datetime.datetime.now().weekday()))).replace("-", "") print(thisfriday)
返回
20191025
2. 下周星期五
lastfriday = str(datetime.date.today() + datetime.timedelta(days= (11 - datetime.datetime.now().weekday()))).replace("-", "") print(lastfriday)
返回
20191101