How to add months to a date (datetime object)?

Aahz aahz at pythoncraft.com
Mon Mar 16 08:57:01 EDT 2009


In article <b324a517-85ee-4260-832d-cde81eb46e0e at d36g2000prf.googlegroups.com>,
John Machin  <sjmachin at lexicon.net> wrote:
>On Mar 16, 3:08=A0pm, a... at pythoncraft.com (Aahz) wrote:
>> In article <roy-C75465.16270015032... at news.panix.com>,
>> Roy Smith =A0<r... at panix.com> wrote:
>>>>
>>>> Besides your behavior, one could equally well argue that a 31st repeat
>>>> on months without a 31st should just be dropped, or that it should
>>>> carry over onto the 1st of the next month (ignoring the complications
>>>> of February). Which behavior one needs is completely
>>>> context-dependent.
>>>
>>>Indeed. =A0For example, my wife started her current job on a Feb 29th. =
>=A0There
>>>are significant financial events that happen on various anniversaries of
>>>her employment (vesting of stock and retirement benefits). =A0It really =
>is
>>>important that everybody know exactly what is meant by "10 years from Fe=
>b
>>>29th, on a given year", and what it means in one context may not mean wh=
>at
>>>it means in another.
>>
>> Because I'm well-aware of such issues, I would have asked to make my
>> official start date March 1. =A0;-)
>
>Which means that any goodies accruing after 4, 8, etc years are
>granted on 1 March instead of the (obvious?) 29 February.
>
>What you want is an agreement that the anniversary of commencement in
>any year is the last day of February.

You may want that; I'd rather just have less hassle.  Nobody will ever
have problems with March 1.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Adopt A Process -- stop killing all your children!



More information about the Python-list mailing list