unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: John Cowan <cowan@ccil.org>
Cc: zefram@fysh.org, 21912@debbugs.gnu.org
Subject: bug#21912: TAI<->UTC conversion botches the unknown
Date: Mon, 22 Oct 2018 01:54:11 -0400	[thread overview]
Message-ID: <871s8ia5mk.fsf@netris.org> (raw)
In-Reply-To: <CAD2gp_Ru5sOoxPN5un7=OFCJd-B8OiZyNrkqs5-nBxO+=_JoRQ@mail.gmail.com> (John Cowan's message of "Sun, 21 Oct 2018 08:50:38 -0400")

Hi John,

John Cowan <cowan@ccil.org> writes:

> What is more, there are no TAI<->UTC conversion tables from before
> 1961 (when UTC began) and probably never will be.  There was heated
> debate in the R7RS-small working group, and we finally settled on a
> compromise:
>
> (current-second) [r]eturns an inexact number representing the current
> time on the International Atomic Time (TAI) scale. The value 0.0
> represents midnight on January 1, 1970 TAI (equivalent to ten seconds
> before midnight Universal Time) and the value 1.0 represents one TAI
> second later. Neither high accuracy nor high precision are required;
> in particular, returning Coordinated Universal Time plus a suitable
> constant might be the best an implementation can do.
>
> I now see that the "ten seconds" is incorrect, and I am filing an
> erratum: the correct figure is 4.2131700 seconds per
> <http://maia.usno.navy.mil/ser7/tai-utc.dat>.

Actually, the correct TAI-UTC delta on January 1, 1970 TAI is
approximately 8 seconds.  You are misinterpreting the relevant line from
that file:

 1968 FEB  1 =JD 2439887.5  TAI-UTC=   4.2131700 S + (MJD - 39126.) X 0.002592 S

This means that TAI-UTC = 4.2131700 + (MJD - 39126) * 0.002592, where
MJD is the modified julian day of the desired TAI-UTC delta.  In this
case, the MJD (modified julian day) of midnight UTC January 1, 1970 is
40587, and plugging that into the equation above yields TAI-UTC =
8.000082 seconds.

If you are doubtful, see the "Atomic Time and Leap Seconds" graph, which
shows a graph of TAI-UTC over the years 1958 to 2017, on the following page:

  http://jjy.nict.go.jp/mission/page1-e.html

Note that between January 1961 and January 1972, the TAI-UTC delta was
not an integer, and instead of the discontinuous leap second jumps that
we've had since 1972, the two clocks ran at different rates in those
years.

       Mark





  reply	other threads:[~2018-10-22  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 16:44 bug#21912: TAI<->UTC conversion botches the unknown Zefram
2018-10-20 22:23 ` Mark H Weaver
2018-10-21 12:50   ` John Cowan
2018-10-22  5:54     ` Mark H Weaver [this message]
2018-10-22 14:50       ` John Cowan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871s8ia5mk.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=21912@debbugs.gnu.org \
    --cc=cowan@ccil.org \
    --cc=zefram@fysh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).