This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
Section: 29.7.2 [time.clock.system] Status: C++11 Submitter: Pete Becker Opened: 2009-01-07 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [time.clock.system].
View all issues with C++11 status.
Discussion:
29.7.2 [time.clock.system]: to_time_t is overspecified. It requires truncation, but should allow rounding. For example, suppose a system has a clock that gives times in milliseconds, but time() rounds those times to the nearest second. Then system_clock can't use any resolution finer than one second, because if it did, truncating times between half a second and a full second would produce the wrong time_t value.
[ Post Summit Anthony Williams provided proposed wording. ]
[ Batavia (2009-05): ]
Move to Review pending input from Howard. and other stakeholders.
[ 2009-05-23 Howard adds: ]
I am in favor of the wording provided by Anthony.
[ 2009-10 Santa Cruz: ]
Move to Ready.
Proposed resolution:
In 29.7.2 [time.clock.system] replace paragraphs 3 and 4 with:
time_t to_time_t(const time_point& t);-3- Returns: A time_t object that represents the same point in time as t when both values are
truncatedrestricted to the coarser of the precisions of time_t and time_point. It is implementation defined whether values are rounded or truncated to the required precision.time_point from_time_t(time_t t);-4- Returns: A time_point object that represents the same point in time as t when both values are
truncatedrestricted to the coarser of the precisions of time_t and time_point. It is implementation defined whether values are rounded or truncated to the required precision.