# New Ticket Created by  Zefram 
# Please include the string:  [perl #126122]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=126122 >


Reusing again the function I explained in [perl #126119], let's look
at 1950:

$ ./perl6 -e 'sub leaps-between ($a, $b) { (Instant.from-posix($b) - 
Instant.from-posix($a)) - ($b - $a) }; say leaps-between(-631152000, 
-599616000)'
0

Allegedly no leaps.  As with [perl #126121], this is not correct.

Unlike the situation in [perl #126121], prior to 1961 there is no
definition of UTC.  This breaks the POSIX definition of time_t.  There are
two reasonable approaches to this situation.  The first is to say that
POSIX time values are meaningless prior to 1961.  If that route is taken,
Instant.from-posix() must signal an error for such time_t values.

The other approach is to tacitly modify the POSIX definition for the
pre-UTC era.  time_t values are clearly based on some version of UT, and
in the pre-UTC era this can be taken to be UT1.  If the resolution to
[perl #126121] is to use something other than UTC for the [1961, 1972)
era, then for consistency that choice would have to be extended to the
pre-1961 era also.  (If rubber-seconds UTC is used for [1961, 1972),
the choice remains open for the pre-1961 era.)

If a non-UTC UT is used prior to 1961, another problem soon arises.
Instant values are supposedly counting atomic seconds, so are based on
TAI.  But TAI is only defined as far back as atomic clocks have been in
continuous operation: back to mid-1955.  Prior to that there is no TAI.
We could therefore say that Instant values can't be constructed for
that era.  This would affect all ways of constructing Instant values:
not just .from-posix(), but also subtraction from an acceptable Instant.

But TAI is, in this context, easier to substitute for than UTC.  A time
scale sufficiently TAI-like for our purposes can be extended back based
on TT, the theoretical ideal time scale that TAI attempts to realise.
The correspondence between UT1 and TT can be reasonably estimated for
times many centuries before the present.  Such estimates, ultimately
using a quadratic formula such as I proposed in [perl #126119], could form
the basis of an Instant.from-posix() implementation for the pre-TAI era.

Estimates of this nature would almost always yield non-zero `leap counts'
(really, slippage between UT and (pseudo-)atomic time).  The slippage
was certainly non-zero in 1950.  Leap counts would also normally be
fractional, unless some synthetic proleptic integral-leaps UTC were used
rather than UT1.

-zefram

Reply via email to