Does anybody know of a QUICK way to reckon the difference in months between two dates?

It is always possible to count the months one by one with a loop, but it seems so clumsy

Does anybody know of a QUICK way to reckon the difference in months between

two dates?

It is always possible to count the months one by one with a loop, but it

seems so clumsy

This looks nice:

http://labix.org/python-dateutil#head-ba5ffd4df8111d1b83fc194b97ebecf837add454

The example found under "Let's try the other way around." in the text

gives what you need:

relativedelta(datetime(2003, 10, 24, 10, 0), TODAY)

relativedelta(months=+1, days=+7, hours=+10)

Che

## ···

On Thu, Jan 15, 2009 at 5:44 PM, raffaello <barbarossa.platz@gmail.com> wrote:

C M wrote:

## ···

On Thu, Jan 15, 2009 at 5:44 PM, raffaello <barbarossa.platz@gmail.com> wrote:

Does anybody know of a QUICK way to reckon the difference in months between

two dates?

It is always possible to count the months one by one with a loop, but it

seems so clumsy

This looks nice:The example found under "Let's try the other way around." in the text

gives what you need:relativedelta(datetime(2003, 10, 24, 10, 0), TODAY)

relativedelta(months=+1, days=+7, hours=+10)

Che

I recommend the dateutil model as well. It is very flexible and handy for date manipulations.

Mike

Thanks.

## ···

2009/1/16 Mike Driscoll mike@pythonlibrary.org

C M wrote:

On Thu, Jan 15, 2009 at 5:44 PM, raffaello barbarossa.platz@gmail.com wrote:

Does anybody know of a QUICK way to reckon the difference in months between

two dates?

It is always possible to count the months one by one with a loop, but it

seems so clumsy

This looks nice:

http://labix.org/python-dateutil#head-ba5ffd4df8111d1b83fc194b97ebecf837add454

The example found under “Let’s try the other way around.” in the text

gives what you need:

relativedelta(datetime(2003, 10, 24, 10, 0), TODAY)

relativedelta(months=+1, days=+7, hours=+10)

Che

I recommend the dateutil model as well. It is very flexible and handy for date manipulations.

Mike

wxpython-users mailing list