[issue1673409] datetime module missing some important methods
report at bugs.python.org
Sat Dec 1 22:01:03 CET 2007
Chris AtLee added the comment:
timedelta.todays() could be useful in general I suppose. I think
timedelta.toweeks() could be omitted since it's simple division by an
easy to recognize constant...also the timedelta docs say that it stores
data in terms of microseconds, seconds, and days.
OTOH tohours(), tominutes(), etc. (all the units that the constructor
uses) could be useful in some cases.
My feeling is that adding a method for each time unit bloats the API too
much. Personally I've only ever wanted to know the number of seconds a
timedelta represents. It seems like seconds are a good base unit to
support since it allows easier interoperability with other python types
and external data.
Tracker <report at bugs.python.org>
More information about the Python-bugs-list