Refer to this solution :https://www.5axxw.com/questions/content/gzoq3q
Specific code
sqlLongSss="SELECT * FROM table1 ;"
df=pd.read_sql(sqlLongSss,con=con)
tt1="0713"# A flurry of dates
tt2=datetime.datetime.strptime(tt1, '%H%M').strftime('%H:%M:%S')#P turn time F Turn the string
tt3=datetime.datetime.strptime(tt2,'%H:%M:%S')
tt4=tt3+datetime.timedelta(minutes=10)
tt5=tt4.strftime('%H:%M:%S')
threshold = pd.Timedelta(tt5)
print(threshold)
df['LastTimeHHMM']=pd.to_datetime(df['LastTime']).dt.time
df['Total Time'] = pd.to_timedelta(pd.to_datetime(df['LastupateTimeHHMM'].astype(str)).dt.strftime('%H:%M:%S'))
df_styled = df[ df['Total Time'].apply(lambda x:x > threshold) ]