开发者

Displaying date from string in Python [duplicate]

开发者 https://www.devze.com 2023-03-08 03:07 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Parse date and format it using python?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Parse date and format it using python?

I hav开发者_开发百科e the following string in python:

2011-05-25T02:11:04Z 

How can I convert it to

May, 25th 2:11


datetime.datetime.strptime('2011-05-25T02:11:04Z', '%Y-%m-%dT%H:%M:%SZ') gives you a datetime.datetime object with the correct date / time.

0

精彩评论

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