Boost logo

Boost :

Subject: Re: [boost] [date_time] [#1861] Change for the default duration format
From: Ilya Bobir (ilya.bobir_at_[hidden])
Date: 2009-06-17 19:38:52

Rutger ter Borg wrote:
> Andrey Semashev wrote:
>> What exactly is wrong?
> Streaming of a time duration is broken; IMHO the snippet below shouldn't be
> asserted on. To make things consistent, alternatives could be to impose a
> limit of 100 hours in the concept of a time duration, to introduce a
> limited_time_duration concept, to follow ISO 8601, or to allow more than 99
> hours.
> time_duration a = hours( 10 ); // OK
> std::cout << a << std::endl; // OK
> time_duration b = hours( 100 ); // OK
> std::cout << b << std::endl; // Assertion failure

The assertion is there because the default time duration format is
"%H:%M:%S". This is exactly what I'm proposing to change. I think it
should be "%O:%M:%S" thus imposing no restrictions on the hours field of
a time duration.

Actually, I can not find a notion of a limited time duration in ISO
8601-2004. Instead the third paragraph of section says the

> In these representations the maximum number of digits in a component
> needs to be agreed by the partners in information interchange.

Suggesting that time durations may have variable number of digits for
all fields.

Boost list run by bdawes at, gregod at, cpdaniel at, john at