[LEAPSECS] pick your own length of second

Warner Losh imp at bsdimp.com
Fri Jan 13 11:34:24 EST 2012

On Jan 13, 2012, at 3:41 AM, Zefram wrote:

> Warner Losh wrote:

>> The hard part is getting the API right that expects UTC since there's

>> no unambiguous encoding for the leap second. You have to break some

>> rule to get the job done.


> If your kernel is capable of ticking correctly through a leap

> second, it probably provides the extended clock API (ntp_adjtime)

> for NTP, which provides enough information to unambiguously

> decode the UTC time. The paper describing the mechanism is at

> <http://www.eecis.udel.edu/~mills/database/memos/memo96b.ps>, and

> there are many clues acquired by bitter experience in the code at

> <http://cpansearch.perl.org/src/ZEFRAM/Time-UTC-Now-0.008/lib/Time/UTC/Now.xs>.

The hard part isn't providing A interface that does the right thing. My code does that. The hard part is picking which rule(s) to break in externally defined interfaces that have no concept of leap seconds. For items that return time_t do you repeat timestamps to keep 86400 day length invariant? Or do you break the every day is 86400s invariant, but return no repeats? Both have been tried, and both have issues...


More information about the LEAPSECS mailing list