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
結果は次のとおりです。
-999999999 days, 0:00:00
2つの異なる日付の違いを数えたい. 上記を差し引いたのですが、欲しいものが得られません。2 つの日付を減算して、数分または数時間で結果を取得する方法。