import datetime
import time
print time.time()
hello = datetime.datetime.now()
print hello
s=datetime.datetime(hello.year,hello.month,hello.day,hello.hour,hello.minute,hello.second)
print time.mktime(s.timetuple())
結果:
1300026963.33
2011-03-13 22:36:03.348000
1300026963.0