Aug-14-2019, 05:30 PM
Hello,
I have a problem with the time format.
Function excerpt:
I can't deal with it for a long time
I have a problem with the time format.
Function excerpt:
format = '%H:%M:%S.%f'
aktual=datetime.datetime.now().time()
try:
timeON = datetime.datetime.strptime(str(aktual), format) - datetime.datetime.strptime(lampaTV.AutoON, format)
except ValueError as e:
print('Time error1:', e)This function is called about 4 times per second and works well but after 2-4 days it throws an error e.g.Quote:ValueError("time data '20:42:11' does not match format '%H:%M:%S.%f'",))
I can't deal with it for a long time
