date1 = datetime.datetime(2012, 10, 10, 10, 15, 44)
date2 = datetime.datetime(2012, 10, 17, 8, 45, 38)
roundedA = date2.replace(second = 0, microsecond = 0)
print roundedA
roundedB = date1.replace(second = 0, microsecond = 0)
print roundedB
minutes = (roundedA - roundedB).min
print minutes
Result is:
-999999999 days, 0:00:00
I want to count 2 different dates differences. I subtracted above, but it does not give me what I want. How to do subtract two dates and get the result in minutes or hours.