Subject: Re: [boost] [date_time] [#1861] Change for the default duration format
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-06-01 11:55:04
Andrey Semashev wrote
On Sunday, May 31, 2009 8:32 AM
> There's a Boost.DateTime ticket:
> The initial problem was that the default handling of the %H
> format specifier (passing it to strftime) played badly with
> time durations that could be longer than 24 hours. The
> resolution was to provide additional %O format specifier
> that does not have 24 hour restriction.
I suspect that's not common -- other than for the OP, perhaps. Jeff's explanation in the associated list message implies that, too.
> However the original poster proposes to change the default
> format of time durations from %H:%M:%S%F to %O:%M:%S%F so
> that formatted durations are always allowed to be longer
> than 24 hours. I mostly agree with this change, however it
> is clearly a breaking change that can affect error checking
> in some cases.
Changing the default will create surprises in some cases. I'd prefer to see error checking -- an exception when the valid %H range is violated. That would alert library users to the problem when violated and the exception message could even suggest the need for %O (as should the docs, of course).
That would provide useful behavior for those violating the range unknowingly and it would avoid breaking compatibility and, reasonable expectations for users.
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com
IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk