I tried to convert a string into epoch time in the following code :
from datetime import datetime
from dateutil import parser
dt = '2018-07-011 00:00:00'
dt = parser.parse(dt)
print(dt)
print (datetime(dt).timestamp())
But it gives the error:
print (datetime(dt).timestamp())
TypeError: an integer is required (got type datetime.datetime)
how do I convert it without any error?