This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Create a datetime.timedelta.totalseconds property
Type: Stage:
Components: Library (Lib) Versions: Python 2.7
Status: closed Resolution: duplicate
Dependencies: Superseder: datetime.timedelta is inconvenient to use...
View: 5788
Assigned To: Nosy List: mw44118
Priority: normal Keywords:

Created on 2009-05-14 16:57 by mw44118, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (1)
msg87741 - (view) Author: Matthew Wilson (mw44118) Date: 2009-05-14 16:57
I do this kind of thing a lot:

>>> from datetime import timedelta
>>> td = timedelta(days=2, seconds=14)
>>> total_duration_in_seconds = td.days * 24 * 60 * 60 + td.seconds

I would like to have a property on the timedelta object do this for me.
Date User Action Args
2022-04-11 14:56:48adminsetgithub: 50270
2009-05-14 21:36:29pitrousetstatus: open -> closed
resolution: duplicate
superseder: datetime.timedelta is inconvenient to use...
2009-05-14 16:57:56mw44118create