Adding 1 month to February 28th results in March 28th

Bug #1292043 reported by Florian Müller
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dateutil
New
Undecided
Unassigned

Bug Description

I actually don't know, whether this is a bug but it was not the behavior I expected so I report it.

Consider the following code:

>>> datetime.date(2014,12,31) + relativedelta(months=1) + relativedelta(months=1) + relativedelta(months=1)
datetime.date(2015, 3, 28)
>>> datetime.date(2014,12,31) + relativedelta(months=3)
datetime.date(2015, 3, 31)

I really expected both examples to result in the same date.

Or want may I do to achieve the same result (other than manually check for february 28th/29th)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.