Re: Predictable Internet Time

Joe Touch <> Wed, 29 March 2017 14:44 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2C298126DD9 for <>; Wed, 29 Mar 2017 07:44:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -6.9
X-Spam-Status: No, score=-6.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id OwXF5fdcRsME for <>; Wed, 29 Mar 2017 07:44:45 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 5EA88129526 for <>; Wed, 29 Mar 2017 07:44:40 -0700 (PDT)
Received: from [] ( []) (authenticated bits=0) by (8.13.8/8.13.8) with ESMTP id v2TEhpek016872 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 29 Mar 2017 07:43:52 -0700 (PDT)
Subject: Re: Predictable Internet Time
To: Patrik Fältström <>
References: <> <> <> <> <> <> <> <> <> <>
Cc: Phillip Hallam-Baker <>, Tony Finch <>, IETF Discussion Mailing List <>, Jared Mauch <>
From: Joe Touch <>
Message-ID: <>
Date: Wed, 29 Mar 2017 07:43:50 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
X-ISI-4-43-8-MailScanner: Found to be clean
Archived-At: <>
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: IETF-Discussion <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 29 Mar 2017 14:44:49 -0000

Hi, Patrik,

On 3/28/2017 10:52 PM, Patrik Fältström wrote:
> On 28 Mar 2017, at 19:47, Joe Touch wrote:
>> On 3/27/2017 11:37 PM, Patrik Fältström wrote:
>>> Joe,
>>> I have read your I-D and like it! Let me start there :-)
>>> What I think is not clear enough is the problem with POSIX, and it should be more clear in some place, maybe section 6.1, that POSIX definition which is in use in quite a number of systems do not handle leap second very well. Too many do believe the time_t definitions include the number of seconds since epoch when in reality it does not (as you note in the definitions).
>> I can make that more clear, but AFAICT POSIX time is *defined* as seconds since the Unix epoch *not counting* leap seconds at all.
> Well, one of the problems is that the specification of POSIX time is a bit unclear.
>>> One could even question whether it is Continuous as two seconds will have the same number since epoch around the addition of a leap second
>>> It is Continuous by definition.
>> When UTC adds a leap second, nothing different happens to POSIX time.
> No, that is not correct if you look at the day when the leap second is added.
> POSIX is number of (days * 86400) plus seconds inside the current day.

POSIX asserts that a "day" = 86400 * "seconds" but defines neither day
nor second.

It definitely says it does not include leap seconds, so there cannot be
"plus seconds inside the current day" - doing that assumes that POSIX
days are correlated to UTC days, but that's never stated.

>  This implies if there is a day with a leap second there will be 86401 seconds which also will be the first second the following day.

A UTC day with a leap second clearly has to use a different definition
of either 'second' or 'day' than POSIX, which requires that every day
has exactly 86400 seconds.

>>> There are some people that have suggested a change, for example <> but I have not seen any movement. Maybe you know more than me on this?
>> AFAICT, that's just attempting to redefine the <time.c> interface as returning UTC rather than POSIX time.
> The UNIX time_t struct do deliver UTC, including leap seconds, but the number of seconds from epoch is wrong regarding leap seconds. Includes one leap second within the day of the leap second being added and without leap seconds otherwise.
time_t in POSIX is supposed to return a signed integer of the number of
seconds since the Unix epoch.

any more complicated structure is an attempt by a system to convert its
internal time to UTC, which requires knowing about leap seconds as well
as knowing the relation of the local internal "second" vs the SI version.

>> Which works *IF* your machine has access to updated leap-second information, e.g., via NTP.
> Correct, if one have access to leap seconds, one could adjust the number of seconds and that could happen already today as POSIX definition is a bit unclear on this. 

IMO, it's very clear that leap adjustments are not part of POSIX time.

> But people have not implemented it. So instead for example Google smear the leap second over the day so that there is not bump in the road, and they run NTP servers that do give back this smeared time that differs from UTC.
They're not using POSIX time then; they're using an internal
approximation of UTC to provide time to NTP.