Need to convert the time 00:00:00 of each day to epoch time, below is the code I have:
import datetime
today = datetime.datetime.now()
today_morning = today.strftime('%y%m%d') + "000000"
epoch = int(today_morning.strftime('%s'))
print(epoch)
I get the following error:
AttributeError: 'str' object has no attribute 'strftime'
If anyone has any advice, please share it. I have looked around at other answers, but they seem to be for Python 2.X and for the current time, not a predetermined time. I am looking for Python 3.X answers.