Aug-14-2019, 05:30 PM
Hello,
I have a problem with the time format.
Function excerpt:
This function is called about 4 times per second and works well but after 2-4 days it throws an error e.g.
I can't deal with it for a long time
I have a problem with the time format.
Function excerpt:
1 2 3 4 5 6 7 |
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) |
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
