PyDocs

Nav

Data Types

timedelta.total_seconds

datetime

method of timedelta · Added in 3.2
  • timedelta.total_seconds()
Total seconds in the duration.
1 Example
>>> # Components of another_year add up to exactly 365 days
>>> import datetime as dt
>>> year = dt.timedelta(days=365)
>>> another_year = dt.timedelta(weeks=40, days=84, hours=23,
...                             minutes=50, seconds=600)
>>> year == another_year
True
>>> year.total_seconds()
31536000.0
from the Python docs
See Also
No see-alsos for datetime/timedelta.total_seconds
0 Notes
No notes for timedelta.total_seconds