I have string time in the following format
2016-12-10T13:54:15.294
I am using the following method to format the time:
time.strptime(
I think your date format is incorrectly specified in string. This should work:
import datetime a = '2016-12-10T13:54:15.294' b= datetime.datetime.strptime(a,'%Y-%m-%dT%H:%M:%S.%f') print b