Re: [Cbor] draft-ietf-cbor-date-tag-02 - handling of time zone offsets

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 01 July 2020 09:05 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 778B53A0C76; Wed, 1 Jul 2020 02:05:41 -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=ham 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 Y5INJQwLD4M4; Wed, 1 Jul 2020 02:05:39 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 25A423A0C75; Wed, 1 Jul 2020 02:05:38 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id B27B5670; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.198]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id zec18FSQym5D; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "DFN-Verein Global Issuing CA" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by hermes.jacobs-university.de (Postfix) with ESMTP id 6202520154; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10028) with ESMTP id nO82oVUU7pYJ; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
Received: from localhost (anna.jacobs.jacobs-university.de [10.50.218.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by hermes.jacobs-university.de (Postfix) with ESMTPS id 0D750200E4; Wed, 1 Jul 2020 11:05:37 +0200 (CEST)
Date: Wed, 01 Jul 2020 11:05:36 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Carsten Bormann <cabo@tzi.org>
Cc: draft-ietf-cbor-date-tag@ietf.org, cbor@ietf.org
Message-ID: <20200701090536.mqkfjebfzhz5phls@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
References: <20200701072123.hnyhzemagtotnuyl@anna.jacobs.jacobs-university.de> <DD477DBD-3F3F-48FA-BADC-FF550CC3D4F7@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <DD477DBD-3F3F-48FA-BADC-FF550CC3D4F7@tzi.org>
X-Clacks-Overhead: GNU Terry Pratchett
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/TwnHDBO_CqaAKoEgIXi790G_WNY>
Subject: Re: [Cbor] draft-ietf-cbor-date-tag-02 - handling of time zone offsets
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, 01 Jul 2020 09:05:42 -0000

On Wed, Jul 01, 2020 at 10:18:29AM +0200, Carsten Bormann wrote:
> Hi Juergen,
> 
> thank you for that comment.
> 
> There are two different concepts of “date", and I think the current draft needs to be more explicit that it is about one and not the other.
> 
> > On 2020-07-01, at 09:21, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> > 
> > Hi,
> > 
> > I just saw your CBOR date type and it seems it does not include a
> > timezone offset. This means a date value does not represent a 24 hour
> > time interval but something larger.
> 
> Well, it represents the abstract date, as opposed to a time period starting at 00:00 on that date and ending at 24:00, both in some time zone (which in practice may be 23, 24, 24.00028, or 25 hours).
> 
> Angela Merkel’s birthday was 1954-07-17.  You will find that on her passport.  The passport will be mute about the time zone in which she was born, as that is irrelevant to the identification principle.  (Other example: I was born at 00:05 UTC, but that doesn’t mean I have a different birthday in New York, where that specific instant would have been 20:05 the previous day, I think.)

I am not sure about Angela's passport but my passport in addition
states where I was born (which implies a certain time zone). I do not
know whether this example is useful or not, perhaps you just want to
say that in some use cases the time zone does not matter and this is
fine.

But on the other hand, two systems may tag an event with 1954-07-17
but in UTC they would be not the same dates or two systems can tag an
event with two different dates but they are actually the same date in
UTC. In distributed systems operating across many timezones, simple
comparisons of date values can be surprising.
 
> > XML schema's date type allows the
> > optional inclusion of a timezone offset.
> 
> Which is useful when you want to convert a date into that ~24-hour time period.

Or you want to compare dates, see above.

> > The date definition in
> > draft-ietf-netmod-rfc6991-bis-03.txt (still under discussion) includes
> > a mandatory timezone offset (since it was already mandatory for
> > date-and-time). I do not know whether we should have a common approach
> > for this.
> 
> I think there is a use case for these periods (see also draft-bormann-cbor-time-tag for a little more about periods, even though we haven’t started to flesh out that part of the spec).  It is not the one addressed by these tags.
> 
> > Note that your 'number of days since the epoch 1970-01-01 does not
> > really say 1970-01-01T00:00:00 and also leaves it open whether this is
> > calculated in UTC or not (on Unix-like systems, time is usually
> > counted in UTC).
> 
> It doesn’t have to, as it talks about the date, not the anchoring in a time scale of the start and end of the period covering that date in a specific time zone.

> Joerg’s original proposal has a separate tag for time zone, which (with the time zone data base and, depending on the time scale, information about leap seconds) may be used to do the conversion.  This is not included in the current draft, because the use case is for abstract dates, but it certainly will be addressed by some future tags.
> 

If the ambiguity caused by timezones is what this WG wants, fine. But
then I think the WG should add a warning that naive comparisons of
date values can be surprising.

Let me check POSIX.1 that is cited for the epoch. Section 4.16 says:

  If the year is >=1970 and the value is non-negative, the value is
  related to a Coordinated Universal Time name according to the
  C-language expression, where tm_sec, tm_min, tm_hour, tm_yday, and
  tm_year are all integer types:

  tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
    (tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
    ((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400

I read this as POSIX.1 says the calculation has to be done in UTC.

This means you can have date = 1970-01-02 with days since 1970-01-01 = 0, no?

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>