How to add one month to datetime?

John W jmw136 at gmail.com
Fri Oct 21 22:30:48 CEST 2005


Hello,

I have been trying to figure out how to easily add just one month to a
datetime object?

For example if my datetime is: 1/31/2005
I want to get 2/28/2005 after adding one month.

The max I can specify in a timedelta object is days. However, since months
vary in length, I can't just add 30 days.

I have seen where mxDateTimes are being used to do this, but I was wondering
if there is simple way of doing this with built in datetime object?

Thanks in advance.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20051021/18f9333e/attachment.html>


More information about the Python-list mailing list