开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜