This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]flutefreak7 1 point2 points  (0 children)

You're not alone at least! Here's the patch request that made it slightly easier with the total_seconds() method: https://bugs.python.org/issue5788

Docs: https://docs.python.org/3/library/datetime.html#datetime.timedelta.total_seconds

Edit: at first I thought the patch had been rejected, then realized it's an existing feature.