convert date time to timestamp in python

By | 26th July 2015

Simple code but powerful output. One of the ways to get unix timestamp using python.

 

import datetime
import time

print int(time.mktime(datetime.datetime.now().timetuple()))