Python: Converting from `datetime.datetime` to `time.time`
I know this is an old question, but in python 3.3+ there is now an easier way to do this using the datetime.timestamp() method:
from datetime import datetimetimestamp = datetime.now().timestamp()