[LEAPSECS] leapseconds, converting between GPS time (week, second) and UTC

Gary E. Miller gem at rellim.com
Tue Jan 15 16:10:54 EST 2019


Yo Steve!

On Tue, 15 Jan 2019 12:52:43 -0800
Steve Allen <sla at ucolick.org> wrote:

> On Tue 2019-01-15T12:34:11-0800 Gary E. Miller hath writ:
> > Yes, and no.  time_t is just seconds since an epoch.  Which epoch
> > is not well defined.  The epoch may well be anything.  See "man
> > difftime".  
> 
> That evokes a challenge for all time nuts that I can make based on
> reading Bulletin Horaire.
> 
> What is the epoch that was used for TAI?

According to wikipedia:

https://en.wikipedia.org/wiki/International_Atomic_Time

"As of 31 December 2016, when another leap second was added,[3] TAI is
exactly 37 seconds ahead of UTC."

> I expect that many can give an answer, and that nobody can give the
> correct answer.

"TAI in this form was synchronised with Universal Time at the beginning
of 1958,"


> > The best bet is to ask the kernel for the current TAI time, and work
> > with that.  Use the leap seconds file to convert TAI to UTC in your
> > code.  Or just use TAI for everything.  
> 
> The trick is to find a source that will set a POSIX system to TAI,

Easy: NTPD.

> and
> then to avoid the gotchas that happen when such a system interacts
> with other POSIX systems.

So don't let it, except by NTPD.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: OpenPGP digital signature
URL: <https://pairlist6.pair.net/pipermail/leapsecs/attachments/20190115/139bc214/attachment.sig>


More information about the LEAPSECS mailing list