0

Possible Duplicate:
Parse date and format it using python?

I have the following string in python:

2011-05-25T02:11:04Z 

How can I convert it to

May, 25th 2:11
Community
  • 1
  • 1
Meir
  • 1
  • You can also use [isodate](http://pypi.python.org/pypi/isodate/) since the string is a valid [ISO-8601](http://en.wikipedia.org/wiki/ISO_8601) date string. – Matt Ball May 25 '11 at 14:18

1 Answers1

2

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.

Graeme Perrow
  • 51,937
  • 20
  • 74
  • 119