How to truncate the time from a datetime object in Python

Truncating the time from a datetime.datetime object removes the time information, leaving only the date information.

Solution for How to truncate the time from a datetime object in Python : You can use datetime.datetime.date() to get only the date from a datetime Call datetime.datetime.date() to return a date object with the same year, month, and day as datetime.datetime.


how-to-truncate-the-time-from-a-datetime-object-in-python