How to calculate the difference in days when dattime object contains hour and minute

Hi,

Column 3 in the exercise file (from the exercise:
https://app.dataquest.io/m/353/working-with-dates-and-times-in-python/10/summarizing-appointment-lengths )

Contains a .datetime object including date and time. Imagine the appointments are more than one day and you only have to calculate the difference in days. How would you do this when a column contains a day and time, but you only need to calculate the difference in days (and ignore the beginning and end time of the appointment).

Looking forward to your response,
Jeroen

Hi jeroenstikkelorum

Try the following

length = appt_end_date - appt_start_date
n_days = length.days

Thanks.