<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 16, 2015 at 3:48 PM, Ken Murchison <span dir="ltr">&lt;<a href="mailto:murch@andrew.cmu.edu" target="_blank">murch@andrew.cmu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe this is a FAQ but I haven&#39;t found the answer.<br>
<br>
Having studied up the tzfile(5) format and written some code to produce these files, I&#39;m wondering why the files in zoneinfo-leaps include the leap records AND adjust the transition times by the appropriate number of leap seconds.  This seems redundant to me.  If the file includes the leap second records, why not let the consumer adjust the transitions?</blockquote><div><br></div><div>Because even after you have found the prevailing offset using the adjusted transition times you still need to break down the resultant &quot;local&quot; seconds count into the YMDhms fields, and that is most easily done using an 86400-seconds-per-day value.  That is, it helps to undo the adjustment.</div><div><br></div><div>You also need the leap records to determine the magnitude of the tm_sec field during leaps (see the &quot;hit&quot; variable, which probably shouldn&#39;t be a bool BTW).</div><div><br></div><div>Finally, the leap records are also used to implement the time2posix() and posix2time() functions for translating to/from Posix timestamps.</div></div></div></div>