//parses some string into that format.
datetime1 = datetime.strptime(somestring, \"%Y-%m-%dT%H:%M:%S\")
//gets the seconds from the above date.
timestamp1 = time.mk
import time
import datetime
from email.Utils import formatdate
rightnow = time.time()
utc = datetime.datetime.utcfromtimestamp(rightnow)
print utc
print formatdate(rightnow)
The two outputs look like this
2009-10-20 14:46:52.725000
Tue, 20 Oct 2009 14:46:52 -0000