Re: Predictable Internet Time

Nico Williams <> Tue, 28 March 2017 17:39 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 36567129687 for <>; Tue, 28 Mar 2017 10:39:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -4.796
X-Spam-Status: No, score=-4.796 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id OMUq2enoKV6p for <>; Tue, 28 Mar 2017 10:39:23 -0700 (PDT)
Received: from ( []) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 7E4921293FC for <>; Tue, 28 Mar 2017 10:39:23 -0700 (PDT)
Received: from (localhost []) by (Postfix) with ESMTP id C26CF1406B1A; Tue, 28 Mar 2017 10:39:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed;; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to;; bh=fHW5IjlEurhM3q 5xu5QLqEKATQc=; b=WrFzkv0i3jWSSKI72DDldR+mT4HFiEHs0/WLEU/cNhU9zq itcKXPq2a0HC+yxKrrtvZDL3IvsXUc/hytJu1nyx8e7/bzKusyaXCBiAYXpC4Wib pLe/VVzzwWYHdzR+UB3T3/Rq7MpLQeHsnhoj9dfygX8jHBv3IAaAuyEBZI/f8=
Received: from localhost ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: by (Postfix) with ESMTPSA id 86C0A1406B0A; Tue, 28 Mar 2017 10:39:20 -0700 (PDT)
Date: Tue, 28 Mar 2017 12:39:18 -0500
From: Nico Williams <>
To: Stewart Bryant <>
Subject: Re: Predictable Internet Time
Message-ID: <20170328173916.GE7490@localhost>
References: <> <> <> <> <> <> <>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <>
User-Agent: Mutt/1.5.24 (2015-08-30)
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: Tue, 28 Mar 2017 17:39:25 -0000

On Tue, Jan 03, 2017 at 06:35:03PM +0000, Stewart Bryant wrote:
> Yes, the system should use a leap-second-free constant-duration-seconds time
> for everything. It is only humans that need the variable jumpy version of
> time presented to them, and that is a UI issue.

I don't think that's quite right.

Unix time is canonically a count of seconds since an epoch and admits no
leap seconds.  A conversion of Unix time to adjusted (i.e., with leap
seconds added) time since the same epoch would be nice, as well as:

 - conversion from either to broken down time
    - with seconds count up to 60 when converting from seconds-with-leaps
 - formatting of dates from either as well as from broken down time
    - but when converting from seconds-with-leaps the formatted string
      can show seconds-in-minute values of 60
    - whereas when converting from Unix seconds the formatted string can
      never show seconds-in-minute values of 60
 - parsing to broken down time and to seconds-since-epoch types
    - ignoring leap seconds when converting to Unix time
    - correctly accounting for all leap seconds prior to that time when
      converting to seconds-with-leaps-since-epoch

It's all about data typing.  In POSIX C API terms, we need new functions
to deal with seconds-with-leaps-since-epoch, and obviously a lot of
prayer because there's no way in C to distinguish one integer type from
the other (well, the new type could be wrapped in a struct..).

We will have to deal with multiple kinds of time as long as different
applications/users need different definitions of time.  Astronomers may
need corrected time, while bankers may want to ignore leap seconds --
all on the same systems (same OSes, same code libraries).

Functionally this is about data typing -- preferably strong data typing.

Smearing is a third time representation that also needs conversion to
the other types (more opportunity for bugs!); it leaves a bad taste.  It
may work for some apps though, but all nodes had better smear in exactly
the same way -- within your tolerances -- if your app depends on time
for synchronization.