from datetime import datetime today = datetime.now().weekday() print("0表示周一,2表示周二,...,6表示周日") print('查看今天周几:') print(today) week=datetime.strptime("20191001", "%Y%m%d").weekday() print('查看19年国庆周几:') print(week)