On 2014-07-08, at 08:57, Rob van der Heij wrote:

> On 8 July 2014 14:29, John Gilmore <[email protected]> wrote:
> 
> 
>> The z/Architecture TOD clock provides values trhat are analogous to
>> International Atomic Time, TAI, ones, which are innocent of
>> leap-second corrections.  UTC values do contain these corrections, and
>> IBM provides facilities for incorporating their then current net
>> effect in any notional STCKE value (or not).
>> 
> 
> While it's true that the TOD is ticking steady without knowing about leap
> seconds, once you use ETR/STP with NTP to keep pace, the TOD produced by
> STCK will effectively give UTC which, as you point out, includes those leap
> seconds. When a leap second is inserted in UTC, the TOD (like other NTP
> linked systems) will slow down during the rest of the night and be on time
> in the morning.
>  
No.  There are tables in the Principles of Operation which give TOD
values and corresponding UTC values at each leap second until the
date of publication.  These tables make it clear that the TOD runs
not on UTC, but on TAI - 10 seconds (i.e. TOD runs at the atomic clock
rate with orgin at 1900-01-01 00:00:10 in proleptic TAI.)

Current UTC is got by subtracting the correction in CVTLSO from the
value returned by STCK.  I know of no z/OS supplied facility that
correctly converts historic TOD values to UTC.  (It's not clear
whether STCKCONV does this; IBM refuses to provide detailed documentation
of the behavior of STCKCONV, calling it "common knowledge".  IMO,
"common knowledge" without even a citation is a shabby alternative
to documentation.)

GNU utilities under Linux or Cygwin using the TZDATA tables do an
excellent job of converting historic TAI timestamps to UTC.  For example:

    putenv( "TZ=right/Etc/Zulu");
    for ( t = 915148820; t<=915148823; t++ )  /* Circa Jan, 1999 leap second 
32.  */
         showTAI( t );

... (essential subroutines omitted for brevity) prints:

    Thu Dec 31 23:59:59 1998
    Thu Dec 31 23:59:60 1998
    Fri Jan  1 00:00:00 1999
    Fri Jan  1 00:00:01 1999

I know JWG objects to the designation of the embolistic second as
"23:59:60".  Yes, it contradicts the notion of congruence, but what
is a better name for it.

Interestingly, the TZDATA tables show the same 10-second bias as the
TOD, with their origin at 1970-01-01 00:00:10.  In fairness, the
GNU/TZDATA documentation is also meager.  I inferred much of this by
reverse engineering.

-- gil

Reply via email to