> 3? I only see one, though with lots of optional fields.
I meant the three: PnYnMnDTnHnMnS, PnW, and P<date>T<time>.
> That format also doesn't allow for visual space.
Yes, it's more meant for durations that are exchanged between software,
not entered by humans.
> The little question remaining though is "how many seconds in a year"
> and, more importantly, "how many seconds in a month"? In other words,
> if some one in February were expecting P1M to represent a 28 day duration
> and a 31 day duration had it been March, um, well,
Very good point. Maybe this means the functionality is better broken down
into a parsing stage and a conversion stage which ultimately produces seconds.
The state between these two would be a struct { year, months, weeks, days, ...
}.
Hmm?
> Dealing with "leap seconds" would get extremely over the top.
Yes. Leap seconds are important if you are at NASA or doing astronomy, but not
otherwise.
Bruno