I have a variable storing a date object
CreateDate = keyData["CreateDate"]
that is storing a value like "2017-01-11 19:40:26+00:00"
(depends on the date) and I am wanting to use that date in addition with today's date to find out how many days it has been between the two. So for example if the create date was 2017-07-10 and today's date is 2017-07-18 then I would like the output to be the amount of days passed. I have tried working with the datetime module like datetime.combine(date.today(), createdate) - datetime.combine(date.today(), todaysDate)
but still run into issues and think there might be a simpler way to get the total days passed between the two.
todaysDate = strftime("%Y-%m-%d %H:%M:%S", gmtime())
todaysDate = str(todaysDate)
todaysDate = todaysDate[0:10]
todaysDate = datetime.strptime(todaysDate, "%Y-%m-%d")
CreateDate = datetime.strptime(CreateDate, "%Y-%m-%d")
totalDays = abs((CreateDate - todaysDate).days)
print (totalDays)
`