I'm trying to get a value from one of my database values, which will be given by subtracting the purchase date from today's date. I've written my code this way:
delta = datetime.now() - item.purchase_date
But this gives me this error:
unsupported operand type(s) for -: 'datetime.datetime' and 'datetime.date'
If I use datetime.datetime.now()
this doesn't work. What am I missing. Thanks.