[tz] What's "right"?

Brooks Harris brooks at edlmax.com
Fri Nov 13 03:00:57 UTC 2020


On 2020-11-12 9:13 PM, Guy Harris wrote:
> On Nov 12, 2020, at 10:34 AM, Steve Allen <sla at ucolick.org> wrote:
>
>> On Thu 2020-11-12T10:11:26-0800 Guy Harris hath writ:
>>> I.e., that's a counter that started as 0 on January 1, 1970,
>>> 00:00:00 UTC, and that increments by 1 every second, rather than
>>> getting adjusted to conform to POSIX.
>> With the historical caveat that as of 1970 there was not yet any
>> official document that specified the name UTC.  Until 1974 UTC was
>> jargon internal to time service bureaus.  Most available sources
>> of time used different terminology.
> So what POSIX says in section 3 "Definitions":
>
> 	https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html
>
> is
>
> 	3.150 Epoch
>
> 	The time zero hours, zero minutes, zero seconds, on January 1, 1970 Coordinated Universal Time (UTC).
>
> and what it says in section A.3 "Definitions" of the Rationale:
>
> 	https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap03.html
>
> is
>
> 	Epoch
>
> 	Historically, the origin of UNIX system time was referred to as "00:00:00 GMT, January 1, 1970". Greenwich Mean Time is actually not a term acknowledged by the international standards community; therefore, this term, "Epoch", is used to abbreviate the reference to the actual standard, Coordinated Universal Time.
>
> with no indication of how they define "zero hours, zero minutes, zero seconds, on January 1, 1970 Coordinated Universal Time (UTC)."
>
> Should there be a request for clarification of what they mean by that?
>
See
IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
A.4 General Concepts
https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html
Section:
A.4.16 Seconds Since the Epoch

I believe Joe Gwinn may have something to say about this section.

In many discussions I've encountered the point that the Posix "the 
epoch" shifts with respect to TAI and UTC is over looked or not made clear.

Consider the following listing showing UTC and Posix times surrounding 
the first leap-second at 1972-06-30 23:59:60 (UTC):

---------------------------------------------------------------------
   UTC  YMDhms.100nano        Secs              Posix    LS << comment
        with leap-seconds     Since             Origin
                              UTC1970           wrt
                              (Posix time_t)    UTC1972

  Posix YMDhms.100nano        Secs              Posix    LS << comment
        without leap-seconds  Since             Origin
        (86400 sec days)      UTC1970           wrt
                              (Posix time_t)    UTC1972
---------------------------------------------------------------------

  1972-06-30 23:59:58.0000000 78796798.0000000 -63072000 00
  1972-06-30 23:59:58.0000000 78796798.0000000 -63072000 00

  1972-06-30 23:59:58.5000000 78796798.5000000 -63072000 00
  1972-06-30 23:59:58.5000000 78796798.5000000 -63072000 00

  1972-06-30 23:59:59.0000000 78796799.0000000 -63072000 00
  1972-06-30 23:59:59.0000000 78796799.0000000 -63072000 00

  1972-06-30 23:59:59.5000000 78796799.5000000 -63072000 00
  1972-06-30 23:59:59.5000000 78796799.5000000 -63072000 00

  1972-06-30 23:59:60.0000000 78796800.0000000 -63072000 00 << leap-second
  1972-07-01 00:00:00.0000000 78796800.0000000 -63072000 00 << NTP Freeze

  1972-06-30 23:59:60.5000000 78796800.5000000 -63072000 00 << leap-second
  1972-07-01 00:00:00.0000000 78796800.0000000 -63072000 00 << NTP Freeze

  1972-07-01 00:00:00.0000000 78796801.0000000 -63072000 01 << TAI-UTC - 
10 = leap-seconds
  1972-07-01 00:00:00.0000000 78796800.0000000 -63071999 01 << Posix 
origin wrt UTC1972

  1972-07-01 00:00:00.5000000 78796801.5000000 -63072000 01 << TAI-UTC - 
10 = leap-seconds
  1972-07-01 00:00:00.5000000 78796800.5000000 -63071999 01 << Posix 
origin wrt UTC1972

  1972-07-01 00:00:01.0000000 78796802.0000000 -63072000 01 << TAI-UTC - 
10 = leap-seconds
  1972-07-01 00:00:01.0000000 78796801.0000000 -63071999 01 << Posix 
origin wrt UTC1972

  1972-07-01 00:00:01.5000000 78796802.5000000 -63072000 01 << TAI-UTC - 
10 = leap-seconds
  1972-07-01 00:00:01.5000000 78796801.5000000 -63071999 01 << Posix 
origin wrt UTC1972


The first line of each pair shows the leap-second compensated YMDhms and 
associated values. The second line shows the uncompensated Posix YMDhms 
and values. The pairs of values increment by 1/2 second at 
100-nanosecond resolution.

The 3rd column shows the seconds since the Posix origin, the 4th the 
Posix origin with respect to (wrt) UTC1972, and the 5th the leap-second 
value.

UTC1972 is the initial alignment point between TAI and UTC:
441763210s (TAI) = 1972-01-01 00:00:10 (TAI) = 1972-01-01T00:00:00 (UTC)

The Posix "the epoch" is defined as 1970-01-01 00:00:00 (UTC), exactly 
63072000 seconds (two years, 365 days x 2 = 730 days x 86400 seconds = 
63072000s) before UTC1972, here called UTC1970.

Before the leap-second the UTC and Posix YMDhms, seconds since UTC1970 
(Posix time_t) and the Posix origin wrt UTC1972 are equal. The YMDhms 
representation of the Posix time_t count of zero 1970-01-01 00:00:00 (UTC).

Origin of Posix time_t = 0 = 1970-01-01 00:00:00 (UTC), 63072000s before 
UTC1972
|------------------ >

After the leap-second the origin of the Posix count (origin of time_t) 
has shifted by one second to 1970-01-01 00:00:01 (UTC) due to the 
omitted count at the freeze imposed on the Posix count by NTP.

Origin of Posix time_t = 0 = 1970-01-01 00:00:01 (UTC), 63071999s before 
UTC1972
|>|---------------- >

After the leap-second is omitted the Posix time_t is left as zero-based 
uninterrupted incrementing count but its origin has shifted by one 
second with respect to UTC. This offset increases by one second for each 
leap-second, currently 27 seconds.

David Mills, the inventor of NTP, explains leap-seconds and the NTP and 
Posix timescales in:

The NTP Timescale and Leap Seconds
https://www.eecis.udel.edu/~mills/leap.html

I draw your attention to the follow extract:
3. How NTP and POSIX Reckon with Leap Seconds

"... Another way to describe this is to say there are as many NTP or 
POSIX timescales as historic leap seconds. In effect, a new timescale is 
reestablished after each new leap second. Thus, all previous leap 
seconds, not to mention the apparent origin of the timescale itself, 
lurch backward one second as each new timescale is established. ..."




More information about the tz mailing list