Re: [Cbor] CBOR tag for RFC 3339 full-date values

Carsten Bormann <cabo@tzi.org> Wed, 11 March 2020 21:09 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9A9933A0C82 for <cbor@ietfa.amsl.com>; Wed, 11 Mar 2020 14:09:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x6xkS25C_4cP for <cbor@ietfa.amsl.com>; Wed, 11 Mar 2020 14:09:42 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5AD243A0CB7 for <cbor@ietf.org>; Wed, 11 Mar 2020 14:09:37 -0700 (PDT)
Received: from [172.16.42.113] (p548DCD70.dip0.t-ipconnect.de [84.141.205.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 48d4Mr5qBkzyT3; Wed, 11 Mar 2020 22:09:27 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <ca2d18b543ce4e60acadad861b8d17da@pdv-FS.de>
Date: Wed, 11 Mar 2020 22:09:17 +0100
Cc: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>, "cbor@ietf.org" <cbor@ietf.org>, Anthony Nadalin <tonynad@microsoft.com>
X-Mao-Original-Outgoing-Id: 605653757.100925-7ddf90c371449ca745f160c7d8ecb3e7
Content-Transfer-Encoding: quoted-printable
Message-Id: <79EDF742-2E54-4829-93F2-BE5A009734E2@tzi.org>
References: <CH2PR00MB0679818FABC93C37FF88A404F5E40@CH2PR00MB0679.namprd00.prod.outlook.com> <AB18584F-BA25-464E-8DEC-217067D7643E@tzi.org> <282209381d8b4a8b8e77515142266df2@pdv-FS.de> <DD66072D-5319-49D7-85A0-F6F2D354A52D@tzi.org> <5D27981B-81C8-43C0-A229-66343D9D67B4@tzi.org> <ca2d18b543ce4e60acadad861b8d17da@pdv-FS.de>
To: "\"Richter, Jörg\"" <Joerg.Richter@pdv-FS.de>
X-Mailer: Apple Mail (2.3608.60.0.2.5)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/4kix-a3n6GuKRCKWqtiS3k9JArw>
Subject: Re: [Cbor] CBOR tag for RFC 3339 full-date values
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Mar 2020 21:09:45 -0000

On 2020-03-11, at 21:31, Richter, Jörg <Joerg.Richter@pdv-FS.de> wrote:
> 
> (Replying to more than one message here)
> 
> Carsten Bormann: 
>> Is that a good way forward?
> 
> I am fine with the suggested procedure. 

Great!

> 
>> What I like about Mike’s draft is that he references RFC 3339, which already is 
>> an established specification for how to write dates textually
> 
> ISO 8601 also defines this format for dates. It is mentioned in the "Detailed Semantics" 
> section of my proposal.

ISO 8601 is very “flexible”.  RFC 3339 uses ISO 8601, but helps by restricting this to commonly used cases.
So I think referencing RFC 3339 is strictly better than just naked ISO 8601.

> Mike Jones:
>> I'm fine merging Jörg's numeric date tag into my draft, provided that the result is 
>> not a polymorphic tag, in which the value could be either a number or a string.  
>> We should allocate separate tags for string date and numeric date, just as tags 
>> 0 and 1 are different, and not polymorphic.
> 
> I've got the impression that using a polymorphic tag would be no major problem.
> We can even specify that decoders might only support one representation of the tag.
> I think it would have the same effect if a decoder supports only one of the two tags.
> But either way I would have no objections to using two tags.

I’m not sure I like the term “polymorphic” here too much — in any case, the “value” would be a date.  The content could be both text and number.  Tag 1 already does this (integer vs. floating-point), so we already have to deal with these (i.e., allow applications to not just say “Tag 1”, but “Tag 1 with integer content”).  But we did separate Tag 0 and Tag 1, mostly because the semantics of the value are subtly different.  Are they here?

> Laurence Lundblade:
>> I’d suggest the numeric date be restricted to integers. No floats, bignums,
>> decimal fractions… 
> 
> Yes, that was the plan. Only major types 0 and 1. 

Finer granularity between dates would be times, which we already have, so this naturally should be integers.

>> Fractions of days can be represented by tag 0 or tag 1 using
>> hours, minutes, seconds. 64-bit integer counts of days are large enough.
> 
> This I don't understand. The proposal only handles whole days as one number.

Right.  Only full days.  (The related observation is that these are always in the local time of some context that is not expressed, which is rather different from our time tags.)

> Another thing to consider:
> We should mention that this tag(s) use the proleptic Gregorian calendar. So that 
> dates before the Gregorian calendar have a unique semantics.

Good point.  In 7049bis, we just say:

Negative values (major type 1 and negative floating-point numbers) are
interpreted as determined by the application requirements as there is
no universal standard for UTC count-of-seconds time before
1970-01-01T00:00Z (this is particularly true for points in time that
precede discontinuities in national calendars).  […]

That is less of a problem on the date-only side (as long as dates change on local midnight… and not noon), so we may be able to be more specific.

Grüße, Carsten