can’t compare datetime.datetime to datetime.date

There is a datetime.date() method for converting from a datetime to a date.

To do the opposite conversion, you could use this function datetime.datetime(d.year, d.month, d.day)

Leave a Comment