from datetime import datetimetarget_time = '2020-01-09 22:32:14' #实际时间
format_pattern = '%Y-%m-%d %H:%M:%S'
cur_time = '2020-08-06 00:00:00' #在这时间之后difference = (datetime.strptime(target_time , format_pattern) - datetime.strptime(cur_time, format_pattern))
if difference.days < 0:print(target_time, '在当前时间之前')
else:print(target_time, '在当前时间之后')