In article <49bd3ab8$0$510$bed64...@news.gradwell.net>, tinn...@isbd.co.uk 
wrote:

> I have a date in the form of a datetime object and I want to add (for
> example) three months to it.  At the moment I can't see any very
> obvious way of doing this.  I need something like:-
> 
>     myDate = datetime.date.today()
>     inc = datetime.timedelta(months=3)
>     myDate += inc
> 
> but, of course, timedelta doesn't know about months. I had a look at
> the calendar object but that didn't seem to help much.

Well, before you can "add three months" to something, you need to explain 
what that means.

What is Nov 29th plus 3 months?

What is Jan 31st plus 3 months?

Months are different lengths.  Asking to "add 3 months" is kind of like 
asking, "If I'm somewhere in the continental US (east of the Mississippi 
River) and move three states to the west, how many miles have I moved?"
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to