I am trying to convert a pandas datetime to an epoch using the code below.
import time
import pandas as pd
compare_date = pd.datetime.today()+pd.DateOffset(days=-60)
print time.mktime(datetime.datetime.strptime(compare_date, "%Y-%m-%d").timetuple())
It's throwing an error
'unicode' object has no attribute 'mktime'
I tried with this code as well
t = (2009, 2, 17, 17, 3, 38, 1, 48, 0)
secs = time.mktime( t )
print secs
And, it's still throwing the same error. I am using Python version 2.7.5. What am I missing here?