python不同格式日期和系统时间的比较
def compare_date(time_get): #用于直接比较网页日期与当前系统日期
'''
time_get:你需要用来与当前系统日期来比较的日期,可能来自于网页爬虫之类的(可以是中文格式:20年12月24日)
'''
stp = time.strftime('%Y-%m-%d')
stp_list = re.findall(r"\d+\.?\d*",stp) #将当前系统日期转换为list = ['20','12','24']
time_getlist = re.fi.
原创
2020-12-24 12:42:34 ·
547 阅读 ·
3 评论