I\'m trying to convert a string \"20091229050936\" into \"05:09 29 December 2009 (UTC)\"
>>>import time >>>s = time.strptime(\"200912290509
time.strptime returns a time_struct; time.strftime accepts a time_struct as an optional parameter:
time.strptime
time_struct
time.strftime
>>>s = time.strptime(page.editTime(), "%Y%m%d%H%M%S") >>>print time.strftime('%H:%M %d %B %Y (UTC)', s)
gives 05:09 29 December 2009 (UTC)
05:09 29 December 2009 (UTC)