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

Laurence Lundblade <lgl@island-resort.com> Mon, 16 March 2020 19:22 UTC

Return-Path: <lgl@island-resort.com>
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 E532B3A0F68 for <cbor@ietfa.amsl.com>; Mon, 16 Mar 2020 12:22:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.36
X-Spam-Level:
X-Spam-Status: No, score=-3.36 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-1.463, SPF_HELO_NONE=0.001, SPF_NONE=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 ZjuU3R_sXbJY for <cbor@ietfa.amsl.com>; Mon, 16 Mar 2020 12:22:23 -0700 (PDT)
Received: from p3plsmtpa06-02.prod.phx3.secureserver.net (p3plsmtpa06-02.prod.phx3.secureserver.net [173.201.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 11B4B3A09AD for <cbor@ietf.org>; Mon, 16 Mar 2020 12:22:23 -0700 (PDT)
Received: from [192.168.1.78] ([76.167.193.86]) by :SMTPAUTH: with ESMTPA id DvJejg0O3JHZdDvJejEHFR; Mon, 16 Mar 2020 12:22:22 -0700
X-CMAE-Analysis: v=2.3 cv=KYasTjQD c=1 sm=1 tr=0 a=t2DvPg6iSvRzsOFYbaV4uQ==:117 a=t2DvPg6iSvRzsOFYbaV4uQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=IkcTkHD0fZMA:10 a=48vgC7mUAAAA:8 a=gKmFwSsBAAAA:8 a=yMhMjlubAAAA:8 a=rSNq6B1uzVQi6kzghJkA:9 a=fpj-FYEl631FWnq0:21 a=tG4otHbj-72ldxEB:21 a=QEXdDO2ut3YA:10 a=w1C3t2QeGrPiZgrLijVG:22 a=nnPW6aIcBuj1ljLj_o6Q:22
X-SECURESERVER-ACCT: lgl@island-resort.com
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
From: Laurence Lundblade <lgl@island-resort.com>
In-Reply-To: <DM6PR00MB06840C6A6DD8669780A98BEFF5F90@DM6PR00MB0684.namprd00.prod.outlook.com>
Date: Mon, 16 Mar 2020 12:22:21 -0700
Cc: "\"Richter, Jörg\"" <Joerg.Richter@pdv-FS.de>, "cbor@ietf.org" <cbor@ietf.org>, Carsten Bormann <cabo@tzi.org>, Anthony Nadalin <tonynad@microsoft.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <3601F656-D758-40D5-B8A3-E86EB6A5F2B8@island-resort.com>
References: <DM6PR00MB06840C6A6DD8669780A98BEFF5F90@DM6PR00MB0684.namprd00.prod.outlook.com>
To: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>
X-Mailer: Apple Mail (2.3445.104.11)
X-CMAE-Envelope: MS4wfG07JifQEhR48L163UdXD39f04TDTZsttUUs9LmeS3le2HVJ6h8xWtD0O2G0SCffgyAPjqMzybOMD2lJAzngWLDGBSs/bs4KWOWbZT/qBVFiR122f+iP 2bXujymSHuBWSHXC+SQHdnf+i2U87EGJjlh1ozGXf/s7JMJ9xKZDi0Jvqi+2vK+SUzdCIQzSxHM5tNk+xv4wdFwSZErRCqbmVoKs04NuO+1l6tC44wSrsFSf MUIYe/bmCFPuBfe7+h+Qe1edQvDDW0hGPLO7vmYWoaRrrXCIYGhCJUoCw8Wd1zFbR+p+f0FFZkgVmR6Gaz5IaA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/bbhBSWxEXmW75r_xqimyoQk5Hsg>
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: Mon, 16 Mar 2020 19:22:30 -0000

FYI, I did a quick implementation of the single tag proposal that Carsten made. The implementation doesn’t try to do conversion from one form to the other. It just returns a string for one for and an integer for the other. I don’t think it needs to do the conversion.  The implementation was done as an addition to QCBOR that already handles tag 0 and 1.

The implementation was very simple and easy. The two tag proposal that Mike made is just as simple and easy.

LL
 



> On Mar 16, 2020, at 11:52 AM, Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org> wrote:
> 
> Jörg - please respond to my request below for co-author information.
> 
> 				Thanks,
> 				-- Mike
> 
> -----Original Message-----
> From: Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org> 
> Sent: Wednesday, March 11, 2020 3:11 PM
> To: Carsten Bormann <cabo@tzi.org>; "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
> Cc: cbor@ietf.org; Mike Jones <Michael.Jones@microsoft.com>; Anthony Nadalin <tonynad@microsoft.com>
> Subject: Re: [Cbor] CBOR tag for RFC 3339 full-date values
> 
> The point of having the tag is that the code knows what follows.  If a polymorphic tag were used, in which two unrelated representations of dates are legal, then the code doesn't know what follows.  And it also opens up questions that it would be cleaner to never have to consider - questions such as "If the polymorphic tag is adopted, must Mobile Driver's Licenses accept both representations?"  And "Will interoperability be harmed if some Mobile Driver's Licenses use one representation and some use the other?"  (The answer to that one is probably "Yes, interoperability will be harmed".)
> 
> Carsten, I take your point about both integers and floats being acceptable for tag 1.  But those are closely related (numeric) representations of the same thing.  Whereas a date string versus number of days relative to the Epoch are nearly unrelated representations, with fairly complicated conversion rules between them (involving leap years, leap centuries, leap 400th years, etc.).
> 
> Given that Jörg stated below that he's OK with using different tags, I propose that we move forward with using tag 1004 (requested) for RFC 3339 full-date values and tag char('d') (requested) for integer number of days relative to the Epoch.  If I don't hear objections soon, I'll publish that draft.
> 
> Jörg - I'll also add you as a co-author.  What affiliation and e-mail address for you should I use?  And is there a URL for a blog or Webpage you'd also like me to include for you?
> 
> 				Cheers,
> 				-- Mike
> 
> -----Original Message-----
> From: CBOR <cbor-bounces@ietf.org> On Behalf Of Carsten Bormann
> Sent: Wednesday, March 11, 2020 2:09 PM
> To: "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
> Cc: cbor@ietf.org; Mike Jones <Michael.Jones=40microsoft.com@dmarc.ietf.org>; Anthony Nadalin <tonynad@microsoft.com>
> Subject: [EXTERNAL] Re: [Cbor] CBOR tag for RFC 3339 full-date values
> 
> 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
> 
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor