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

Steve Allen sla at ucolick.org
Tue Jan 15 15:52:43 EST 2019


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?

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

> 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, and
then to avoid the gotchas that happen when such a system interacts
with other POSIX systems.

--
Steve Allen                    <sla at ucolick.org>              WGS-84 (GPS)
UCO/Lick Observatory--ISB 260  Natural Sciences II, Room 165  Lat  +36.99855
1156 High Street               Voice: +1 831 459 3046         Lng -122.06015
Santa Cruz, CA 95064           https://www.ucolick.org/~sla/  Hgt +250 m


More information about the LEAPSECS mailing list