I use arrow
to handle dates and discovered that I do not know how to get natively the number of seconds between two dates:
>>> import arrow
>>> first = arrow.get('2019-03-06')
>>> second = arrow.get('2019-02-06')
>>> (first-second).days
28
>>> (first-second).seconds
0
From the example above it looks like .days
gives the expected output, but .seconds
rather gives the number of seconds there are "at the seconds level", that is when looking exclusively at seconds. This would mean that the maximum number is 60
.
This is not true, however:
>>> (arrow.now()-first).seconds
70223
70000 seconds is approximately 19 hours, which would be the correct number of hours between last midnight (start of today) and now (about 20:30).
So I am lost at what .seconds
actually provides.