from datetime import datetime
import time
date = '1573401600'
ltime = time.localtime(int(date))
dateymd = time.strftime("%Y-%m-%d", ltime)
print(dateymd)
print(datetime.strptime(dateymd, "%Y-%m-%d").weekday())
打印结果:
2019-11-11
0
ps:星期表示0-6,所以2019-11-11实际为周一,打印结果为0