时间比较
1 def Trans_time(visite_time): 2 true_time = visite_time / 1000000 - 11644473600 3 time_normal = time.gmtime(true_time) # 转换为普通时间格式(时间数组) 4 dt = time.strftime("%Y-%m-%d", time_normal) # 格式化为需要的格式 5 # print(dt) 6 from_dt = datetime.datetime(2021, 10, 4) 7 start_date = datetime.datetime.strptime(dt, "%Y-%m-%d") 8 if from_dt<=start_date: 9 print(start_date) 10 print("@@@@") 11 return dt