I have the following code and am getting the above error. Since I'm new to python I'm having trouble understanding the syntax here and how I can fix the error:
if not start or date < start: start = date
There is a datetime.date() method for converting from a datetime to a date.
datetime.date()
To do the opposite conversion, you could use this function datetime.datetime(d.year, d.month, d.day)
datetime.datetime(d.year, d.month, d.day)
2.1m questions
2.1m answers
60 comments
57.0k users