1>>> import datetime
2>>> a = datetime.datetime.now()
3>>> b = datetime.datetime.now()
4>>> c = b - a
5
6>>> c
7datetime.timedelta(0, 4, 316543)
8>>> c.days
90
10>>> c.seconds
114
12>>> c.microseconds
13316543
1from datetime import datetime
2import time
3
4datetime1 = datetime.datetime.now()
5# Wait for 1 minute
6time.sleep(60)
7datetime2 = datetime.datetime.now()
8
9difference = datetime2 - datetime1
10print(f"The time difference between the 2 time is: {difference}")