diff --git a/tz.html b/tz.html index a6cbf96..b1e4f31 100644 --- a/tz.html +++ b/tz.html @@ -2824,15 +2824,51 @@ is_leap_second(utc_time<Duration> const& t);
-Returns: If
+t
represents atime_point
during a leap -second insertion, the first member of thepair
has a value of +Returns: Given a list of leap second insertion dates li since +1970-01-01, +ift
is in the range [li, li + 1s), +the first member of thepair
has a value oftrue
, otherwisefalse
. The second member of the returnedpair
holds the number of leap seconds that have been inserted betweent
and 1970-01-01. Ift
represents atime_point
-prior to 1970-01-01, the value is0s
. Ift
represents a -time_point
during a leap second insertion, that full leap second is included +prior to 1970-01-01, the value is0s
. Ift
is in the range +[li, li + 1s), li is included in the count.+[Example: +
+++cout << boolalpha; + +auto t = clock_cast<utc_clock>(sys_days{December/31/2016} + 23h + 59min + 59s + 999ms); +auto p = is_leap_second(t); +cout << t << " : {" << p.first << ", " << p.second << "}\n"; +// 2016-12-31 23:59:59.999 : {false, 26s} + +t += 1ms; +p = is_leap_second(t); +cout << t << " : {" << p.first << ", " << p.second << "}\n"; +// 2016-12-31 23:59:60.000 : {true, 27s} + +t += 1ms; +p = is_leap_second(t); +cout << t << " : {" << p.first << ", " << p.second << "}\n"; +// 2016-12-31 23:59:60.001 : {true, 27s} + +t += 998ms; +p = is_leap_second(t); +cout << t << " : {" << p.first << ", " << p.second << "}\n"; +// 2016-12-31 23:59:60.999 : {true, 27s} + +t += 1ms; +p = is_leap_second(t); +cout << t << " : {" << p.first << ", " << p.second << "}\n"; +// 2017-01-01 00:00:00.000 : {false, 27s} ++—end example] +