I'm trying to get the difference (in days) between today and a previous date here:
from datetime import date
today = date.today() # get today's date
print("Today's date:", today)
new_today = today.strftime("%Y, %#m, %Y") # convert it so that delta.days understands
print(new_today)
f_date = date(new_today)
l_date = date(2014, 7, 11)
delta = f_date - l_date
print(delta.days)
But I get an error:
TypeError: an integer is required (got type str)
I've read multiple threads on this, but they don't address using today's date in the calculation.
What's the best way to perform this calculation?