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.

Author jess.austin
Recipients jess.austin
Date 2009-03-07.05:04:47
SpamBayes Score 6.077857e-05
Marked as misclassified No
Message-id <1236402290.49.0.02662803662.issue5434@psf.upfronthosting.co.za>
In-reply-to
Content
datetime is a wonderful module.  Perhaps the only inconvenient aspect of
using it is dealing with month calculations and comparisons.  This patch
adds a simple class, monthdelta, which represents date offsets in terms
of months.  It supports basic integer-like arithmetic, and also it may
be added to dates and datetimes.  It deals sensibly with leap-year and
month-length issues.  Also provided is a function, monthmod (named by
imperfect analogy to divmod), which allows round-tripping: that is,
taking 2 dates and returning a (monthdelta, timedelta) tuple that
represents the interim between the dates.

Note: I have named the class "monthdelta", but in light of recent
python-dev discussions I should probably rename this to "MonthDelta".
History
Date User Action Args
2009-03-07 05:04:50jess.austinsetrecipients: + jess.austin
2009-03-07 05:04:50jess.austinsetmessageid: <1236402290.49.0.02662803662.issue5434@psf.upfronthosting.co.za>
2009-03-07 05:04:48jess.austinlinkissue5434 messages
2009-03-07 05:04:47jess.austincreate