from fake_useragent import UserAgent
headers={
'User-Agent':UserAgent().random
}
import datetime
def judgee(timestr):
nowTime_str = datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
e_time = time.mktime(time.strptime(nowTime_str,"%Y-%m-%d %H:%M"))
s_time = time.mktime(time.strptime(timestr, '%Y-%m-%d %H:%M'))
#日期转化为int比较
diff = abs(int(s_time)-int(e_time))
if diff>604800:
return 0
else:
return 1