//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
datetime.utcfromtimestamp is probably what you're looking for:
>>> timestamp1 = time.mktime(datetime.now().timetuple()) >>> timestamp1 1256049553.0 >>> datetime.utcfromtimestamp(timestamp1) datetime.datetime(2009, 10, 20, 14, 39, 13)