<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 2, 2016 at 11:47 AM, Howard Hinnant <span dir="ltr">&lt;<a href="mailto:howard.hinnant@gmail.com" target="_blank">howard.hinnant@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sep 2, 2016, at 11:42 AM, Bradley White &lt;<a href="mailto:bww@acm.org">bww@acm.org</a>&gt; wrote:<br>
&gt;<br>
&gt; Just to clarify, the leap-second table in the tzdata is only for running in &quot;right&quot; mode, where clocks tick through leaps and so don&#39;t need any indication that leaps happen.<br>
<br>
</span>This may be your only use of the leap-second table, but it is not my use.<br>
<br>
Here is working code for me:<br>
<br>
    #include &quot;chrono_io.h&quot;<br>
    #include &quot;tz.h&quot;<br>
    #include &lt;iostream&gt;<br>
<br>
    int<br>
    main()<br>
    {<br>
        using namespace date;<br>
        using namespace std::chrono_literals;<br>
        auto t0 = to_gps_time(sys_days{2017_y/<wbr>jan/1} - 500ms);<br>
        auto t1 = to_gps_time(sys_days{2017_y/<wbr>jan/1} + 500ms);<br>
        std::cout &lt;&lt; t1 - t0 &lt;&lt; &#39;\n&#39;;<br>
    }<br>
<br>
This should output:<br>
<br>
    2000ms<br>
<br>
which indicates the insertion of a leap second into my gps_clock a few months from now.  Unfortunately it currently (and incorrectly) outputs:<br>
<br>
    1000ms<br></blockquote><div><br></div><div>Sure, you may use *a* leap-second table.  But tzdata only includes one to generate &quot;right&quot; zoneinfo files.</div><div><br></div><div>Aside: It would be unfortunate, for any expression X, if ((X + 500ms) - (X - 500ms)) was not 1000ms.</div></div></div></div>