1# Format it into seconds
2>>> datetime.datetime(2012,04,01,0,0).strftime('%s')
3'1333234800'
4
5# OR, subtract the time with 1 Jan, 1970 i.e start of epoch time
6# get the difference of seconds using `total_seconds()`
7>>> (datetime.datetime(2012,04,01,0,0) - datetime.datetime(1970,1,1)).total_seconds()
81333238400.0