Re: A structured format for dates?

Austin William Wright <aaa@bzfx.net> Thu, 16 June 2022 17:30 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DA551C157B37 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 16 Jun 2022 10:30:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.76
X-Spam-Level:
X-Spam-Status: No, score=-2.76 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=bzfx.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hf8-YzjVKA-X for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 16 Jun 2022 10:30:15 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AD370C14F74F for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 16 Jun 2022 10:30:15 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1o1tHy-0006G2-9y for ietf-http-wg-dist@listhub.w3.org; Thu, 16 Jun 2022 17:28:14 +0000
Resent-Date: Thu, 16 Jun 2022 17:28:14 +0000
Resent-Message-Id: <E1o1tHy-0006G2-9y@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <aaa@bzfx.net>) id 1o1tHx-0006F9-Ev for ietf-http-wg@listhub.w3.org; Thu, 16 Jun 2022 17:28:13 +0000
Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <aaa@bzfx.net>) id 1o1tHv-0001D8-TB for ietf-http-wg@w3.org; Thu, 16 Jun 2022 17:28:13 +0000
Received: by mail-pl1-x629.google.com with SMTP id f8so1790196plo.9 for <ietf-http-wg@w3.org>; Thu, 16 Jun 2022 10:28:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bzfx.net; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SXnSUJvjT/QCR536/MgL3mRnERjdgOs2poapkoHOMbM=; b=tV3iRQ1Cqf7I6a4UKRmtjEVDXzj4RJKhkDu9p8x33bRvxPWBKvFQBrw1D8vkJtZw9G XMtkieAL9qGoWddz1Hb5cQJN0K8g/Ozm+ALq+wdOqtfacWbXGx9eQrimHsiwKgekXYDD fPZ+m64DCBoV+bW31oAkE7U+/1YiI/FawNmM4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=SXnSUJvjT/QCR536/MgL3mRnERjdgOs2poapkoHOMbM=; b=Ni9XYZq3QjfKIsxPLlFRRHri5Y8yaxmtwTJcaYfOmP87kGw+aJ0FsU1hwmJIeqht9H fiChc6HZmOGn25UKGEuKMFlRIi5YTYUou0Z0y7zomCWOyWT3o1Patu5BGaSOvT7AUIp7 sDEWjQqe2jOHZDB+4SHdxYxSdu58Gmj9ckn7AqdKtCVzu2I6YhV2+g10w2VN1a/Xfd2n 9tO2ekZB+69r4keSsmK9YWfiNsHbVTsMlNdqjFUF3o732AAsvVkt8mh8MWvWfJg44Z2e 7SfvH20QTteD116SV/T0Z/s0fTJ/W5M4YyKaglJeoFxRLkCUqv+p7wB50C07J3vIh8zA RXhw==
X-Gm-Message-State: AJIora+7ZdQAC+aDK0CCe7YGfHuWTebQViY0FC/JxsG2epCtqYYWnYFw 1WwIgrUAYA8hwar8Htxy9UsjA3wX85HHAQ==
X-Google-Smtp-Source: AGRyM1vwU33mNhnitzRk5dWICZRlWaBWknZD0nJj2XKsZd22khjf3IPYAZ0mumTN4WXP+QPGI+dafA==
X-Received: by 2002:a17:90a:cb8c:b0:1e6:715f:ed28 with SMTP id a12-20020a17090acb8c00b001e6715fed28mr6089408pju.69.1655400480442; Thu, 16 Jun 2022 10:28:00 -0700 (PDT)
Received: from smtpclient.apple (71-223-174-56.phnx.qwest.net. [71.223.174.56]) by smtp.gmail.com with ESMTPSA id g26-20020aa7875a000000b005183f333721sm2042087pfo.87.2022.06.16.10.27.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jun 2022 10:27:59 -0700 (PDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\))
From: Austin William Wright <aaa@bzfx.net>
In-Reply-To: <20220616062211.GA28947@1wt.eu>
Date: Thu, 16 Jun 2022 10:27:58 -0700
Cc: Mark Nottingham <mnot@mnot.net>, Poul-Henning Kamp <phk@phk.freebsd.dk>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <C1814D1B-D048-4A03-9C26-1BC2E20334A9@bzfx.net>
References: <8C9C4A5C-45DB-43C0-9769-2A7510854AB1@mnot.net> <202206160546.25G5k0KR056033@critter.freebsd.dk> <B34DEE15-DE14-4DC2-B6D0-F0CD1823EC30@mnot.net> <20220616062211.GA28947@1wt.eu>
To: Willy Tarreau <w@1wt.eu>
X-Mailer: Apple Mail (2.3696.100.31)
Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=aaa@bzfx.net; helo=mail-pl1-x629.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=aaa@bzfx.net domain=bzfx.net), signature is good
X-W3C-Hub-Spam-Status: No, score=-6.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1o1tHv-0001D8-TB 92ef609b850a96a6dbb665206c375e2d
X-Original-To: ietf-http-wg@w3.org
Subject: Re: A structured format for dates?
Archived-At: <https://www.w3.org/mid/C1814D1B-D048-4A03-9C26-1BC2E20334A9@bzfx.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40130
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

> On Jun 15, 2022, at 23:22, Willy Tarreau <w@1wt.eu> wrote:
> 
> The thing is, the effort to present *any* human-readable string is always
> worse than converting an integer (or decimal) to the final representation,
> since it's required to pass through such an integer-based representation
> at one point during the operation anyway.

This isn’t necessarily true. Many representations like RFC3339 compare in ASCII order (given certain constraints like, Z time and fixed length year). If only a comparison is needed, then a string-based representation may be just as good.

> The epoch-based representation also has the benefit that you're not required
> to have to guess a timezone nor to be confused by ":60" resulting from a leap
> second once every few years.

Quick, off the top of your head: What happens to the Unix epoch when it passes through a leap-second? What about a negative leap second? [1]

I figure, if fractional seconds are important, then being able to represent a leap-second is probably of some importance.

> Also, applications that want to rely on text-based dates do not all agree
> on the format. Some would like to see the day-of-week there, others don't
> want ISO8601 because it's less readable by humans etc. Thus I'd rather go
> for integer+fraction only.

But disagreement on a Date format is exactly the problem that is being solved here. It is not obvious to me that (a string representation of) a number ought to be the winner just because there has been disagreement in the past.

Cheers,

Austin Wright.


[1] Unix timestamps do not count leap seconds, so positive/negative leap seconds will repeat/skip a Unix timestamp, unless you’re using a more sophisticated scheme like leap smear. As far as I can tell there’s no standardized behavior, it seems likely that naive implementations could exhibit behavior like: 1483228799.0 (2016 Dec 31) ... 1483228799.9 -//-> 1483228799.0 (discontinuous jump) ... 1483228799.9 ... 1483228800.0 (2017 Jan 01)