dates changed between python 2.7 and 3.x, you will have to check the appropriate python documentation and examples on the web. Here is an example of what is returned in python 3.11
d1 = datetime(2024, 1, 1)
import datetime
d1 = datetime.datetime(2024, 1, 1)
d2 = datetime.datetime(2024, 1, 31)
d2 - d1
datetime.timedelta(days=30)
(d2 - d1)/365
datetime.timedelta(seconds=7101, microseconds=369863)
so you will have to convert to your appropriate date format and or desired scalar value
... sort of retired...