>>> import datetime
>>> datetime.datetime(2002, 12, 4, 20, 30, 40).ctime()
'Wed Dec 4 20:30:40 2002'
>>> n = datetime.datetime(2006, 8, 11, 23, 32, 43, 109000)
>>> time.mktime(n.timetuple())
1155310363.0
convert
a timestamp to datetime (datetime.datetime.fromtimestamp())