date-arithmetic

How do I find the time difference between two datetime objects in python?

How do I find the time difference between two datetime objects in python? Question: How do I tell the time difference in minutes between two datetime objects? Asked By: Hobhouse || Source Answers: Just subtract one from the other. You get a timedelta object with the difference. >>> import datetime >>> d1 = datetime.datetime.now() >>> …

Total answers: 21