On 1/3/2017 4:00 PM, Tony Finch wrote: > > Joe Touch <touch@xxxxxxx> wrote: > > > > The Posic spec describes how to convert seconds since epoch to UTC; it > > is that conversion where leap seconds come into play. > > No, it describes the reverse, how to convert broken-down UTC time to > seconds since the epoch. You're right; I got it backwards. Except it admits it's an approximation: "A value that approximates the number of seconds that have elapsed since the Epoch." > > > But if the count of seconds includes the leap second, surely the > > > number representing the leap second could be printed properly as :60 ? > > > > UTC defines it that way, so if you want to output the correct UTC value, > > that is the only solution. > > UTC does not define a seconds count UTC includes :60 as a valid time, as was indicated in the leap-second announcement. However, when you are computing epoch time from UTC, you'd have to account for the leap seconds since epoch to correct for the difference in actual elapsed seconds. Joe