Python datetime strptime: unconverted data remains
timeobj = datetime.datetime.strptime(my_time, '%Y-%m-%d %H:%M:%S').isoformat()
File "/usr/lib/python2.7/_strptime.py", line 335, in _strptime
ValueError: unconverted data remains:
The error was an elusive one. The solution was to make sure that the input time string is exactly as the format expected.
The missing piece was an extra space after the string which was causing a format mismatch.
So the solution was to call
strip() on the…