datetime: How to get diff between 2 dates in month units?

Gustavo Niemeyer niemeyer at conectiva.com
Mon Sep 15 13:00:57 EDT 2003


> This is a great module.  Thanks for the link.  What do you think about
> using operator overloading to avoid having to do the
> mx.DateTime.RelativeDateDiff(...) function instead?

It's not possible. The operator is already overloaded to return a
DateTimeDelta, just like the datetime -> timedelta relation.

Btw, I'm working on a relativedelta type which is based on the idea of
RelativeDateDiff, but will work on the python 2.3 standard datetime type
(the algorithm will be a little bit different as well). It'll be ready
soon.

-- 
Gustavo Niemeyer
http://niemeyer.net





More information about the Python-list mailing list