import datetime import time d1=datetime.date.today() t1=time.mktime(d1.timetuple()) d2=datetime.datetime.today() t2=time.mktime(d2.timetuple())