Peter J. Acklam schreef:
> It is the IERS (http://www.iers.org) who decides when leap seconds
> are inserted.  According to their page
> 
>    http://www.iers.org/iers/earth/rotation/utc/table1.html
> 
> the first leap second after 1970 was the second before 1972-07-01
> 00:00:00 UTC.

There cannot have been a leap second 1971-12-31T23:59:60, as the leap
second system was only introduced on 1972-01-01, together with UTC.
Between 1925 and 1972 Universal Time (UT, equal to GMT) was used.

On the page you mention, you can see that UT days were longer than TAI
days. This difference in day length was about 1.2 msec from 1961 to
1966, and about 2.6 msec from 1966 to 1972.

Because of these longer days, UT followed the rotation of the earth much
better than UTC does now; but extra adjustments were still needed: see

    http://www.iers.org/iers/earth/rotation/utc/table2.html

These adjustments were mostly 1/10th of a second. The last of these
adjustments was made just before the introduction of UTC, on 1971-12-31.
As it was meant to bring the UT seconds in synch with TAI seconds (with
an offset of an integer number of seconds), this adjustment was not a
round number, but 0.1077580 seconds.

What does this mean for DateTime?

1) DT::TimeZone::UTC actually describes UT before 1972. This means that
the length of the seconds is variable before that date. (After 1972, 1
DateTime second is equal to 1 SI second. Before 1972, 1 DateTime second
is 1/86400th of the short term average day length.)

2) As TAI (atomic time) counts in seconds of constant length, a TAI
second expressed in DateTime units will be of variable size. In
particular, my DT::F::Epoch::TAI64 implementation is wrong before 1972.
(It's about 1.1 seconds off in 1971 (but it should be 0.1 seconds, if
the extra leap second is removed from DT::LS), about 10 seconds in 1958,
about 5 hours in 500BC.)

3) DT::LeapSecond is wrong about the leap second on 1971-31-12. There
was an adjustment on that day, but not a full second.

4) DT::LeapSecond does not include the small adjustments to UT between
1961 and 1972. This means that durations can be slightly incorrect: the
difference between 1964-04-01T00:00:01 and 1964-03-31T23:59:59 for
example should be 2.1 DateTime seconds (which corresponds to
2.1000000315 SI seconds) instead of 2 seconds.

5) The Date::LeapSecond documentation is wrong: it does not convert
between UTC and UT1 (this difference is always below 1 second), but
between UTC and TAI. DT::LeapSecond doesn't mention UTC or UT1 anywhere,
so it's correct.

Eugene

Reply via email to