[issue1673409] datetime module missing some important methods

Alexander Belopolsky report at bugs.python.org
Tue Nov 11 19:29:46 CET 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

Chris> I keep needing to know the number of seconds that a timedelta
Chris> represents.

I propose an alternative approach that I believe will neatly solve 
fractional vs. whole seconds and multitude of conceivable toxxx methods:

Let's extend timedelta's div and floordiv methods to allow 

>>> (t - epoch) // timedelta(seconds=1)
--> whole seconds

and  

>>> (t - epoch) / timedelta(seconds=1)
--> fractional seconds

----------
nosy: +belopolsky

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1673409>
_______________________________________


More information about the Python-bugs-list mailing list