I'm trying to convert a datetime string to a datetime object. The datetime string looks like this:
2020-05-04 2004:33:39.654942
I tried using datetime.datetime.strptime method by implementing:
datetime.datetime.strptime("2020-05-04 2004:33:39.654942","%Y-%m-%d %H%M:%S:%f")
I however got the following error:
ValueError: unconverted data remains: .654942
I tried using %Y-%m-%d %H%M:%S:%f%Z, %Y-%m-%d %H%M:%S:%f.%Z and %Y-%m-%d %H%M:%S:%f%z, %Y-%m-%d %H%M:%S:%f.%z, however I am still not getting the correct format. Anyone have any suggestions what I can do?
