Re: [Python-Dev] ISO 8601 durations and datetime.timedelta

2014-03-28 Thread Alexander Belopolsky
On Fri, Mar 28, 2014 at 1:13 PM, Skip Montanaro wrote: > Given that the timedelta has more than "a month's" worth of days, how > would you describe it using the ISO8601 duration notation without > referencing a specific point in time? Conversely, given your example, > "P3Y6M4DT12H30M5S", how woul

[Python-Dev] ISO 8601 durations and datetime.timedelta

2014-03-28 Thread Skip Montanaro
Andrew wrote: > I meant ISO 8601 syntax for "durations" [1]. That's exactly what I was referring to. Consider this session: >>> now = datetime.datetime.now() >>> now datetime.datetime(2014, 3, 28, 12, 4, 38, 517110) >>> then = now - datetime.timedelta(days=57, hours=12, minutes=12, seconds=12) >