from datetime import datetime, timedelta import time dtime = datetime.now() + timedelta(seconds=3) unixtime = time.mktime(dtime.timetuple())