Calculate the difference between two datetime objects in Python February 2, 2019 dateTimeDifference = dateTimeA - dateTimeB # Divide difference in seconds by number of seconds in hour (3600) dateTimeDifferenceInHours = dateTimeDifference.total_seconds() / 3600 References https://stackoverflow.com/questions/43305577/python-calculate-the-difference-between-two-datetime-time-objects/43308104 Related