Dealing with trailing decimals at the end of a DateTime
I am trying to convert the string below into a datetime object using datetime.strptime, and I just can't seem to figure out .746Z at the end.
datetime_str = '2022-04-21T08:17:49.746开发者_如何学PythonZ'
datetime_object = datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%S.%z')
print(datetime_object)
精彩评论