I\'m trying to convert a string \"20091229050936\" into \"05:09 29 December 2009 (UTC)\"
>>>import time >>>s = time.strptime(\"200912290509
For me this is the best and it works on Google App Engine as well
Example showing UTC-4
import datetime UTC_OFFSET = 4 local_datetime = datetime.datetime.now() print (local_datetime - datetime.timedelta(hours=UTC_OFFSET)).strftime("%Y-%m-%d %H:%M:%S")