Re: A structured format for dates?

Tommy Pauly <tpauly@apple.com> Wed, 24 August 2022 03:33 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 D23B3C1522D5 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Aug 2022 20:33:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.631
X-Spam-Level:
X-Spam-Status: No, score=-5.631 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=apple.com
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 sHcRy_ZqcXWU for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Aug 2022 20:33:37 -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 11024C14CE37 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 23 Aug 2022 20:33:36 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1oQh8E-00AE55-OW for ietf-http-wg-dist@listhub.w3.org; Wed, 24 Aug 2022 03:32:42 +0000
Resent-Date: Wed, 24 Aug 2022 03:32:42 +0000
Resent-Message-Id: <E1oQh8E-00AE55-OW@lyra.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <tpauly@apple.com>) id 1oQh8C-00AE47-Um for ietf-http-wg@listhub.w3.org; Wed, 24 Aug 2022 03:32:40 +0000
Received: from rn-mailsvcp-ppex-lapp14.rno.apple.com ([17.179.253.33] helo=rn-mailsvcp-ppex-lapp14.apple.com) by titan.w3.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <tpauly@apple.com>) id 1oQh8B-003oBu-Bm for ietf-http-wg@w3.org; Wed, 24 Aug 2022 03:32:40 +0000
Received: from pps.filterd (rn-mailsvcp-ppex-lapp14.rno.apple.com [127.0.0.1]) by rn-mailsvcp-ppex-lapp14.rno.apple.com (8.16.1.2/8.16.1.2) with SMTP id 27O3UCab003158; Tue, 23 Aug 2022 20:32:20 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=content-type : content-transfer-encoding : mime-version : subject : from : in-reply-to : cc : date : message-id : references : to; s=20180706; bh=v/arqXgZCx5duDmFt5chazWtseP/YTTVljKEveQ8U+s=; b=kZO54MHMi+ox4YE4B4jPEAbxTpl8hcMtQx30PEzNzs0mzgfjBaZzhFcmpKZZdGvQQKJi 0tu28LnxsqdART1i9bfPWvUeLNj/20Gf1iIZGvSJaGFeWygkWWS3qdXNwmCUWo7r7cd2 MWFX/7b/41xBHXY0unEgg+9nHXmNLZga6sjt8VxO6I2fEgwBhkID30diAZj8XCItjQOp zlS96Wn/BC/6+bOSneXF/Iqm63yFsrUozzi3w6gKy/QifGOR5a+cB6k3Te5RWVnt987T FH3J5+FeKJ0xlvXGoGVYyO6Sg8Oe3CEsMsZ6Q1xd12C5IXOZh/RhVZY3anFegSJ1B8KA kw==
Received: from ma-mailsvcp-mta-lapp02.corp.apple.com (ma-mailsvcp-mta-lapp02.corp.apple.com [10.226.18.134]) by rn-mailsvcp-ppex-lapp14.rno.apple.com with ESMTP id 3j2vgbm8h4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 23 Aug 2022 20:32:20 -0700
Received: from ma-mailsvcp-mmp-lapp03.apple.com (ma-mailsvcp-mmp-lapp03.apple.com [17.32.222.16]) by ma-mailsvcp-mta-lapp02.corp.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPS id <0RH3010ADOHWEN00@ma-mailsvcp-mta-lapp02.corp.apple.com>; Tue, 23 Aug 2022 20:32:20 -0700 (PDT)
Received: from process_milters-daemon.ma-mailsvcp-mmp-lapp03.apple.com by ma-mailsvcp-mmp-lapp03.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) id <0RH300300OC4R400@ma-mailsvcp-mmp-lapp03.apple.com>; Tue, 23 Aug 2022 20:32:20 -0700 (PDT)
X-Va-A:
X-Va-T-CD: 1ea9fc21d4317491099989f2a1fdb838
X-Va-E-CD: 02a6e54929b7e0e4d75cd752a781bf38
X-Va-R-CD: 4327496eb5c4ee01e8bbdba360a7b29c
X-Va-CD: 0
X-Va-ID: a9454437-d820-478a-9714-2b0982b9f12a
X-V-A:
X-V-T-CD: 1ea9fc21d4317491099989f2a1fdb838
X-V-E-CD: 02a6e54929b7e0e4d75cd752a781bf38
X-V-R-CD: 4327496eb5c4ee01e8bbdba360a7b29c
X-V-CD: 0
X-V-ID: 16f492f4-9ccf-4b84-8138-39c0ed813a34
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-24_02:2022-08-22,2022-08-24 signatures=0
Received: from smtpclient.apple (unknown [17.232.14.227]) by ma-mailsvcp-mmp-lapp03.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPSA id <0RH300JF1OHU6D00@ma-mailsvcp-mmp-lapp03.apple.com>; Tue, 23 Aug 2022 20:32:19 -0700 (PDT)
Content-type: text/plain; charset="utf-8"
Content-transfer-encoding: quoted-printable
MIME-version: 1.0 (1.0)
From: Tommy Pauly <tpauly@apple.com>
In-reply-to: <685890F9-9F68-41EF-AC8C-86ACAD074A38@mnot.net>
Cc: Poul-Henning Kamp <phk@phk.freebsd.dk>, Roberto Polli <robipolli@gmail.com>, HTTP Working Group <ietf-http-wg@w3.org>
Date: Tue, 23 Aug 2022 20:32:08 -0700
Message-id: <A6AA39E9-1E28-419E-8FB3-40824DEEE1B3@apple.com>
References: <685890F9-9F68-41EF-AC8C-86ACAD074A38@mnot.net>
To: Mark Nottingham <mnot@mnot.net>
X-Mailer: iPhone Mail (20A356)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-24_02:2022-08-22,2022-08-24 signatures=0
Received-SPF: pass client-ip=17.179.253.33; envelope-from=tpauly@apple.com; helo=rn-mailsvcp-ppex-lapp14.apple.com
X-W3C-Hub-DKIM-Status: validation passed: (address=tpauly@apple.com domain=apple.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-8.4
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: titan.w3.org 1oQh8B-003oBu-Bm ec39f66642d199dade9c937e3bf12a35
X-Original-To: ietf-http-wg@w3.org
Subject: Re: A structured format for dates?
Archived-At: <https://www.w3.org/mid/A6AA39E9-1E28-419E-8FB3-40824DEEE1B3@apple.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/40346
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 Aug 23, 2022, at 8:15 PM, Mark Nottingham <mnot@mnot.net> wrote:
> 
> Personal response - 
> 
>> On 23 Aug 2022, at 11:27 pm, Tommy Pauly <tpauly@apple.com> wrote:
>> The numeric type is not only simpler to process for a computer, but also should be generally smaller on the wire, particularly if we have binary structured fields one day. The scale of that alone can have a great impact.
> 
> It's important to remember that if/when we have binary structured fields, the binary wire representation can be different from the textual one we're defining now -- for example, it could be the same as that of an integer, but with a different type flag. 
> 
> What we're defining now is merely what the _textual_ (HTTP/1.1-ish) representation of a date is. The underlying data model for dates is separable (see below), as is its mapping to other serialisations of structured types.
> 
>> I imagine it’s also a lot easier to translate *to* the human readable / localized format for a date from the number, since the number is an unambiguous form. Parsing dates the other way (from human readable to machine readable) is where much of the complexity and ambiguity arises, so a scheme that only requires transformations in one direction seems preferable.
> 
> That entirely relies upon the precision of the underlying data model and the rules for transforming it to/from the textual representation. In the previous PR, the underlying data model was an integer, and the rules were fairly precise, so I don't think this is a strong reason to go this way.
> 
> This is why I'm not terribly convinced by the arguments for an integer textual representation so far; I think we can have the best of both worlds (integer data model / human-friendly textual representation) *if* we believe that binary structured fields are going to happen. IMO the only reason we'd choose an integer textual representation is if we didn't believe that.

It’s definitely fair that the binary version can be different. And it is certainly possible (as the previous version did) to make a rigorous set of rules for the date.

Ultimately, this is something that can indeed be spelled either way.

Two minor things that come to mind, that still make me prefer the @Integer format:

- If we expect to have binary header values in a future version (HTTP/4, say), we’ll have the same intermediary scenarios we have today with converting between versions. Certainly we could use the rules to correctly convert between the date-text version and the numeric version, but it would be more complexity than just moving an integer value over (and handling an @ or marking a flag), and buggy implementations may lead to values being closely translated but not perfectly translated.

- If the benefit we’re providing by using the date-text format is to make things more easily human readable, I’ll likely want to have the choice to view the date while debugging in whatever timezone I prefer and using whatever date presentation format I prefer. So, the tools will ideally be translating the value anyway.

Best,
Tommy
> 
> Cheers,
> 
> --
> Mark Nottingham   https://www.mnot.net/