开发者

Dealing with trailing decimals at the end of a DateTime

开发者 https://www.devze.com 2022-12-07 20:19 出处:网络
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.

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

精彩评论

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