Aw: Re: Subtract n months from datetime [Why?]

Karsten Hilbert Karsten.Hilbert at gmx.net
Thu Jun 23 02:36:10 EDT 2022


> What makes sense depends on where you're looking from.
>
> It's 28 February, you need to keep it for 5 years, therefore you could
> reason that you can dispose of it on 28 February, 5 years hence.
>
> However, that happens to be a leap year.
>
> Should you still have it on 29 February?

Nope because that's *after* the 5 years (they end Feb 28).

If it originates on March 1st, however, you shouldn't dispose of it on Feb 29th just yet.

Karsten


More information about the Python-list mailing list