On Sat, Aug 22, 2020 at 7:29 PM Richard Damon <rich...@damon-family.org>
wrote:

> On 8/22/20 1:07 PM, Stephen J. Turnbull wrote:
> > If anything is to be added, I would prefer using ISO 8601 durations.
> >
> > https://en.wikipedia.org/wiki/ISO_8601#Durations
> >
> > The main differences are use of "P" and "T" to signal that it is a
> > duration and allow both minutes and months to be identified by "M",
> > and decimal fractions of the smallest unit present are permitted, and
> > seconds is the smallest unit, so the above would be represented
>
> One issue with allowing Months here is then suddenly an interval becomes
> dependent on when it is, so needs to be keep in a complex form, as a
> month (and year) are variable length time units.
>
> Also, the math gets funny when you do things like this. Jan 31st + 1
> month is Feb 28th (or 29th) + 1 month is March 28th (or 29th), but Jan
> 31st + 2 Months is March 31st, Similarly, adding a month and then
> subtracting a month doesn't always get you back to your starting time.
>

Indeed, datetime.timedelta accepts seconds, minutes, hours, days, and
weeks, but not months or years.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BFPM4AZX7NAARJZGSSGLDUA4NTEZ65LQ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to