How do I convert a datetime.datetime object (e.g., the return value of datetime.datetime.now()) to a datetime.date object in Python?
datetime.datetime
datetime.datetime.now())
datetime.date
Use the date() method:
date()
datetime.datetime.now().date()
2.1m questions
2.1m answers
60 comments
57.0k users