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, 22034@debbugs.gnu.org, 22034-done@debbugs.gnu.org
Subject: bug#22034: time-utc->date shows bogus zone-dependent leap second
Date: Sun, 28 Oct 2018 19:58:03 -0400	[thread overview]
Message-ID: <CAD2gp_QDO7poKJ9O7Zd0mufzZjeyD9eiZPd_sZzURYOdh+kwag@mail.gmail.com> (raw)
In-Reply-To: <871s89ajql.fsf@netris.org>

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

On Sun, Oct 28, 2018 at 4:40 PM Mark H Weaver <mhw@netris.org> wrote:

I believe you're making a subtle error in your identification of UTC
> seconds with TAI seconds.


And I in turn think you (or perhaps someone else)are making an error
in your use of the term "UTC".


> A TAI clock aims to measure the current TAI time, i.e. to measure the
> time interval between the epoch and _you_ in units of TAI seconds,
> i.e. SI seconds as observed on the geoid.
>
> In spatial terms, a TAI clock is analogous to a very precise measuring
> tape which aims to measure the distance between you and an fixed
> conventional point in space, analogous to the TAI epoch.
>

We agree so far.


> In this analogy, a UTC clock is analogous to an equally precise
> measuring tape that is _almost_ identical to the TAI analogue measuring
> tape, but subtly different.  If we place the two measuring tapes side by
> side and ignore pre-1972, we see that the markings are in _precisely_
> the same positions along the entire length of the tape, without the
> slightest deviation, even over long distances.
>
> The difference between the two measuring tapes is that they assign
> different numbers to the markings, and moreover that the UTC analogue
> has a small handful of places where two adjacent markings have the same
> number assigned, and all subsequent numbers are shifted by 1.


Now I think you are entirely right here, modulo a single term: what you are
calling "UTC", I call (and I think correctly), "Posix".  It is Posix time
that
has two identical adjacent markings.

  126230400 |------------
>   126230400 |------------
>

The numbers here are not UTC seconds since the Epoch, but Posix seconds
since the Epoch.  In short, there are exactly 86400 Posix seconds in a mean
solar day, whereas in UTC reckoning there are exactly 1440 minutes, of
which
some may contain more (or less) than 60 seconds.  That is why UTC clocks
displayed 2016-12-13T23:59:60 during the last leap second.  Computer clocks
are normally Posix rather than UTC clocks, and the difference does not
matter
very often.



> $1 = ((126230410 "1973-12-31T23:59:58Z")
>       (126230411 "1973-12-31T23:59:59Z")
>       (126230412 "1973-12-31T23:59:60Z")
>       (126230413 "1974-01-01T00:00:00Z")
>       (126230414 "1974-01-01T00:00:01Z"))
> --8<---------------cut here---------------end--------------->8--


Good.


> >  If I understand correctly, 'time-utc->date' should never return a date
>
>  object with 60 in the seconds field, because those extra seconds have no
> >  representation in time-utc.  They only have representations in time-tai
> >  and time-monotonic.
>

Same story.  Leap seconds have no representation in Posix time, but they
do in UTC time.


> As you can see, 1973-12-31T23:59:60Z and 1974-01-01T00:00:00Z have the
> same representation in TIME-UTC.


That is because what is called UTC time is in fact Posix time.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
It was impossible to inveigle
Georg Wilhelm Friedrich Hegel
Into offering the slightest apology
For his Phenomenology.                      --W. H. Auden, from "People"
(1953)

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

  reply	other threads:[~2018-10-28 23:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 19:51 bug#22034: time-utc->date shows bogus zone-dependent leap second Zefram
2018-10-20 21:42 ` Mark H Weaver
2018-10-22  2:38   ` John Cowan
2018-10-22  6:12     ` Mark H Weaver
2018-10-25 22:21       ` John Cowan
2018-10-28 20:39         ` Mark H Weaver
2018-10-28 23:58           ` John Cowan [this message]
2018-10-29  7:16             ` Mark H Weaver
2018-10-29 22:33               ` Mark H Weaver
2018-10-30  0:23               ` John Cowan
2018-10-30  2:12                 ` Mark H Weaver

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_QDO7poKJ9O7Zd0mufzZjeyD9eiZPd_sZzURYOdh+kwag@mail.gmail.com \
    --to=cowan@ccil.org \
    --cc=22034-done@debbugs.gnu.org \
    --cc=22034@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).