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

Henk Birkholz <henk.birkholz@sit.fraunhofer.de> Wed, 01 July 2020 10:42 UTC

Return-Path: <henk.birkholz@sit.fraunhofer.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 C508F3A0DDB; Wed, 1 Jul 2020 03:42:08 -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_H3=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 BT-YSrn8dIeS; Wed, 1 Jul 2020 03:42:06 -0700 (PDT)
Received: from mail-edgeKA27.fraunhofer.de (mail-edgeka27.fraunhofer.de [153.96.1.27]) (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 3B5973A0DDA; Wed, 1 Jul 2020 03:42:04 -0700 (PDT)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2FFAABxZ/xe/xoBYJlgGQEBAQEBAQEBAQEBAQEBAQEBARIBAQEBAQEBAQEBAQFAgUqBdQaCUQqEJ5BtJZwECwEBAQEBAQEBAQYBAS0CBAEBhEcCghYBJDgTAhABAQYBAQEBAQYEAgKGUIZHAQEBAQIBIw8BBUEQCQIOAggCAiYCAkcQBgEMAQUCAQGCV0uCXR8FkkibBHaBMoVRg1+BQIEOKgGMZw+BTD+BEScMA4JaPodTgmAEkjWGaJs9KAeBWYEGgQcEC5ggBQodgnOJLoR0BieINoUiK4UNjByeXgIEAgkCFYFqgXlNJIM4UBcCDViNUheOJnI3AgYBBwEBAwl8jjEBgRABAQ
X-IPAS-Result: A2FFAABxZ/xe/xoBYJlgGQEBAQEBAQEBAQEBAQEBAQEBARIBAQEBAQEBAQEBAQFAgUqBdQaCUQqEJ5BtJZwECwEBAQEBAQEBAQYBAS0CBAEBhEcCghYBJDgTAhABAQYBAQEBAQYEAgKGUIZHAQEBAQIBIw8BBUEQCQIOAggCAiYCAkcQBgEMAQUCAQGCV0uCXR8FkkibBHaBMoVRg1+BQIEOKgGMZw+BTD+BEScMA4JaPodTgmAEkjWGaJs9KAeBWYEGgQcEC5ggBQodgnOJLoR0BieINoUiK4UNjByeXgIEAgkCFYFqgXlNJIM4UBcCDViNUheOJnI3AgYBBwEBAwl8jjEBgRABAQ
X-IronPort-AV: E=Sophos;i="5.75,299,1589234400"; d="scan'208";a="22812420"
Received: from mail-mtaka26.fraunhofer.de ([153.96.1.26]) by mail-edgeKA27.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 12:42:02 +0200
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BuAAAUaPxe/1lIDI1gGQEBAQEBAQEBAQEBAQEBAQEBARIBAQEBAQEBAQEBAQFAgUqBdQYvclQwLAqEJ5BsJZwECwEDAQEBAQEGAQEtAgQBAYRHAoIUAiQ4EwIQAQEFAQEBAgEGBG2FZ4VuAQEBAwEjDwEFQRAJAg4CCAICJgICRxAGAQwBBQIBAYJXS4JdJJJHmwR2gTKFUYNlgUCBDioBjGcPgUw/gREnDAOCWj6HU4JgBJI1hmibPSgHgVmBBoEHBAuYIAUKHYJziS6EdAYniDaFIiuFDYwcnl4CBAIJAhWBaiKBVk0kgzhQFwINWI1SF44mQTE3AgYBBwEBAwl8jjEBgRABAQ
X-IronPort-AV: E=Sophos;i="5.75,299,1589234400"; d="scan'208";a="85405731"
Received: from mailext.sit.fraunhofer.de ([141.12.72.89]) by mail-mtaKA26.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Jul 2020 12:41:59 +0200
Received: from mail.sit.fraunhofer.de (mail.sit.fraunhofer.de [141.12.84.171]) by mailext.sit.fraunhofer.de (8.15.2/8.15.2/Debian-10) with ESMTPS id 061Afwlq019115 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NOT); Wed, 1 Jul 2020 12:41:58 +0200
Received: from [192.168.16.50] (79.206.156.41) by mail.sit.fraunhofer.de (141.12.84.171) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 1 Jul 2020 12:41:53 +0200
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, Carsten Bormann <cabo@tzi.org>
CC: draft-ietf-cbor-date-tag@ietf.org, cbor@ietf.org
References: <20200701072123.hnyhzemagtotnuyl@anna.jacobs.jacobs-university.de> <DD477DBD-3F3F-48FA-BADC-FF550CC3D4F7@tzi.org> <20200701090536.mqkfjebfzhz5phls@anna.jacobs.jacobs-university.de>
From: Henk Birkholz <henk.birkholz@sit.fraunhofer.de>
Message-ID: <2e979e71-ea3d-77a3-9724-eeb17e028550@sit.fraunhofer.de>
Date: Wed, 01 Jul 2020 12:41:52 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0
MIME-Version: 1.0
In-Reply-To: <20200701090536.mqkfjebfzhz5phls@anna.jacobs.jacobs-university.de>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Originating-IP: [79.206.156.41]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/H_mRLidFKG9ZxUNyshn52YNwwqg>
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 10:42:09 -0000

Hi Jürgen,

comments in-line.

On 01.07.20 11:05, Juergen Schoenwaelder wrote:
> 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.

That is an excellent example. Personally, I think that a geo-location is 
a way more stable reference to a time zone at a given point in time than 
a time zone offset associated with that geo-location (as these change 
surprisingly often over time). Having said that, associating a calendar 
day with a time zone of course supports the association of calendar day 
with my local timescale. Please see below.

> 
> 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.

"in UTC" is the association of a calendar day with a timescale. If you 
do that, time-zones become relevant. If I add a calendar event to my 
schedule, I want to associate it with a local timescale / TZ, otherwise 
I will probably miss the event. That is why calendar days are often 
bundled with a time zone in an event description. It supports the 
association with a given timescale.

>   
>>> 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?

All definitions in IEEE 1003.1 are about timescales and not calendar 
days (as indicated by the use of the UTC timescale).


Viele Grüße,

Henk

> 
> /js
>