Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instant.from-posix has faulty pre-1961 leap second knowledge #4567

Open
p6rt opened this issue Sep 20, 2015 · 1 comment
Open

Instant.from-posix has faulty pre-1961 leap second knowledge #4567

p6rt opened this issue Sep 20, 2015 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 20, 2015

Migrated from rt.perl.org#126122 (status was 'new')

Searchable as RT126122$

@p6rt
Copy link
Author

p6rt commented Sep 20, 2015

From zefram@fysh.org

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

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant