0
我在蟒蛇以下字符串:
2011-05-25T02:11:04Z
我怎樣才能將其轉換爲
May, 25th 2:11
我在蟒蛇以下字符串:
2011-05-25T02:11:04Z
我怎樣才能將其轉換爲
May, 25th 2:11
datetime.datetime.strptime('2011-05-25T02:11:04Z', '%Y-%m-%dT%H:%M:%SZ')
爲您提供具有正確日期/時間的datetime.datetime
對象。
您也可以使用[isodate](http://pypi.python.org/pypi/isodate/),因爲該字符串是有效的[ISO-8601](http://en.wikipedia.org/wiki/) ISO_8601)日期字符串。 – 2011-05-25 14:18:27