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

Carsten Bormann <cabo@tzi.org> Fri, 03 July 2020 07:05 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 959E13A0DBE; Fri, 3 Jul 2020 00:05:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 yUAyzfq01s0h; Fri, 3 Jul 2020 00:05:52 -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 71C513A0DA3; Fri, 3 Jul 2020 00:05:52 -0700 (PDT)
Received: from [172.16.42.112] (p5089ae91.dip0.t-ipconnect.de [80.137.174.145]) (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 49ymFp6WhDzyV1; Fri, 3 Jul 2020 09:05:50 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <20200703064652.m7tuvfcglxyvfque@anna.jacobs.jacobs-university.de>
Date: Fri, 03 Jul 2020 09:05:50 +0200
Cc: draft-ietf-cbor-date-tag@ietf.org, Michael Richardson <mcr+ietf@sandelman.ca>, cbor@ietf.org
X-Mao-Original-Outgoing-Id: 615452750.485857-97bab8709d0a75c98814afdbfd82cf10
Content-Transfer-Encoding: quoted-printable
Message-Id: <2A137293-075C-4862-91C2-CC583B9B2FF6@tzi.org>
References: <20200701072123.hnyhzemagtotnuyl@anna.jacobs.jacobs-university.de> <DD477DBD-3F3F-48FA-BADC-FF550CC3D4F7@tzi.org> <20200701090536.mqkfjebfzhz5phls@anna.jacobs.jacobs-university.de> <5244.1593618673@localhost> <04FEC6E5-F8E9-472D-A4D6-71C6C00D79E6@tzi.org> <20200703060820.ydmbdmp5fy2v6wgf@anna.jacobs.jacobs-university.de> <99A557CE-559D-409A-A3DC-5D20F2F55F5E@tzi.org> <20200703064652.m7tuvfcglxyvfque@anna.jacobs.jacobs-university.de>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/TSXVarYtH5lLMFka1IDZfdvpy4g>
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: Fri, 03 Jul 2020 07:05:57 -0000

> On 2020-07-03, at 08:46, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> 
> On Fri, Jul 03, 2020 at 08:29:01AM +0200, Carsten Bormann wrote:
>> 
>> 
>>> (3) a 'date' value and a 'number of days since 1970-01-01' value can
>>>    be "inconsistent".
>> 
>> Not sure how that can be; a common Gregorian calendar seems to be in use.
>> 
> 
> A system may have determined a local date 1970-01-01, which in UTC is
> 1969-12-31 or 1970-01-01 or 1970-01-02.

Yes, but the UTC time is irrelevant; this is about calendar dates, and if the calendar on my wall says 1969-12-31, that is the date (represented as 100(-1)).
So I think what you are saying is that the current calendar date at the same instant in time (*) may be different in different parts of the world?
That’s why we want to get away from anchoring these dates on a time scale.

> Hence, days since 1970-01-01
> may be -1, 0, or 1, depending on how this is calculated. If the
> 'number of days since 1970-01-01' is always calculated in the same
> unknown local timezone as the local date value, the problem goes away,
> but it is likely difficult to enforce this (unless timzone information
> is explicit).

Doing this conversion in a time zone is dangerous; you’ll need to make sure that you properly round off the daylight savings time transitions.  Better to always to this in world time (UTC), which is then benign (unless your libraries have a bug, see previous message).

Counting calendar sheets ripped off the wall is rather unambiguous, though.

The problems that you are alluding to come from transitioning between the calendar day domain and the time anchored on a time scale domain; additional problems are caused with this when the time involves time zones that vary in world time offset.

I think we need firmer text that makes clear that the dates covered by tags 100 and 1004 are calendar dates, and that conversions between these and times on a timescale can be done, but require attention and usually some additional context.

Grüße, Carsten

(*) No, I’m not opening the relativistic can of worms.