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

[-- Attachment #1: Type: text/plain, Size: 2684 bytes --]

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>.

On Sat, Oct 20, 2018 at 6:25 PM Mark H Weaver <mhw@netris.org> wrote:

> Zefram <zefram@fysh.org> writes:
>
> > Guile ought to be aware of how far its leap table extends, and signal
> > an error when asked to perform a TAI<->UTC conversion that falls outside
> > its scope.
>
> I sympathize with your preference to raise an error rather than return
> invalid results, but unfortunately I don't think this proposal is really
> practical, given the SRFI-19 API.  The main problem is that, although
> it's not specified in the document, the SRFI-19 reference implementation
> uses UTC for all julian days, modified julian days, and dates.  For
> example, 'time-tai->date' and 'time-tai->julian-day' include an implicit
> conversion to UTC.
>
> As a result, if we were to adopt your proposal, it would never be
> possible to print a date more than 6 months in the future, and for users
> of stable distributions such as Debian, it is not be possible to print
> the current date.
>
> We need a way to print future dates.  In theory, we could print future
> dates in TAI without the leap second table, using the convention of
> printing TAI dates as in <https://cr.yp.to/proto/utctai.html>, but
> that's not what SRFI-19 does, and it has no API to support that way of
> printing TAI dates.
>
> Also, it's debatable whether it's desirable to print future dates in TAI
> this way, since in the far future the times will drift far away from
> mean solar time, and the calendar will eventually drift from the usual
> alignment of the solar year to the months on the calendar.
>
> So, I think this is a valid issue, but I don't see how it can be
> addressed within SRFI-19.  I would need to be addressed in a new SRFI,
> and even then it's not clear to me what's the right way forward.
>
> What do you think?
>
>     Regards,
>       Mark
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3567 bytes --]

  reply	other threads:[~2018-10-21 12:50 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 [this message]
2018-10-22  5:54     ` Mark H Weaver
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='CAD2gp_Ru5sOoxPN5un7=OFCJd-B8OiZyNrkqs5-nBxO+=_JoRQ@mail.gmail.com' \
    --to=cowan@ccil.org \
    --cc=21912@debbugs.gnu.org \
    --cc=mhw@netris.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).