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

Carsten Bormann <cabo@tzi.org> Wed, 08 July 2020 05:20 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 9BC3E3A0858; Tue, 7 Jul 2020 22:20:17 -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 sy-OHjVhOB4B; Tue, 7 Jul 2020 22:20:15 -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 832A83A0856; Tue, 7 Jul 2020 22:20:14 -0700 (PDT)
Received: from [192.168.217.116] (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 4B1ngT2xBDzybG; Wed, 8 Jul 2020 07:20:04 +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: <00e401d654e2$bf5e78f0$3e1b6ad0$@augustcellars.com>
Date: Wed, 08 Jul 2020 07:19:58 +0200
Cc: draft-ietf-cbor-date-tag@ietf.org, cbor@ietf.org
X-Mao-Original-Outgoing-Id: 615878398.560549-89ce546d15768d16b1c80aff0c49f275
Content-Transfer-Encoding: quoted-printable
Message-Id: <4CB207D4-4CC4-4AA1-833D-9B1F9B47204B@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> <2A137293-075C-4862-91C2-CC583B9B2FF6@tzi.org> <20200703103212.kwl5pbxubznjqpf6@anna.jacobs.jacobs-university.de> <B4E1605F-4C94-4EC6-B603-0BB725CEF34F@tzi.org> <00e401d654e2$bf5e78f0$3e1b6ad0$@augustcellars.com>
To: Jim Schaad <ietf@augustcellars.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/leARHhHcsHVARk_C-6e5sEBe43s>
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, 08 Jul 2020 05:20:18 -0000

> On 2020-07-08, at 06:46, Jim Schaad <ietf@augustcellars.com> wrote:
> 
> Mike,
> 
> Based on the messages that I have seen, I would suggest the following actions:
> 
> Create a new section dealing with the following: 

Let me try...

> a) a definition of what calendar day means

A calendar day is a day on a (here: the Gregorian) calendar.
The specific mapping of calendar days on civil time (here: UTC) is established by convention outside the scope of the date tags.

> b) a definition of a term other than Unix Epoch to be used as the basis.  This  is a point in time rather than a calendar day so having this as the basis point seems to be generation frisson.  It would appear that it is better to use 1970-01-01 as a POSIX calendar date epoch.

1970-01-01 was chosen as the epoch for counting calendar days for the date tags because it is convenient on systems that have Posix date/time libraries available.

> c) Guidance on how to use two points in time to compute a calendar day count.

Well, that goes deep into date/time library APIs.
But, usually, these APIs allow you to apply a timezone to a point in time and retrieve a calendar day and a time-of-day.
By zeroing out the time-of-day, time deltas can be produced that, divided by 86400 and *rounded* to the nearest integer give you a calendar day count.

Watch out when using historical dates (the Gregorian calendar has a discontinuity in 1582, which was integrated into the civil calendars either immediately or later, say, 1752, 1753, … or 1923 if you are in Greece); make sure these are actually on the (proleptic) Gregorian calendar already.  Also, historically, the calendar date changed at sunrise, noon (astronomical day/Julian day number), or sunset on some calendars, and the year number on March 25th.  Again, not a problem as long as all dates are on the proleptic Gregorian calendar and your date/time libraries aren’t broken (which many are for historical dates).

> d) Information on why it is a bad idea or how to compare a calendar date and a point in time.

A calendar date is not anchored on a timescale, only adding timezone information does that.

> e) Guidance on how to compare two calendar dates (this should be easy).

If you have the day number (tag 100), that is easy.
If you have the RFC 3339 full-date, go through a date/time library (using UTC as a time zone is the simplest approach).

Amazing.  I would not have thought that talking about calendar dates would evoke all this complexity...

Grüße, Carsten

> 
> Jim
> 
> 
> 
>> -----Original Message-----
>> From: CBOR <cbor-bounces@ietf.org> On Behalf Of Carsten Bormann
>> Sent: Friday, July 3, 2020 5:11 AM
>> To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
>> Cc: draft-ietf-cbor-date-tag@ietf.org; Michael Richardson
>> <mcr+ietf@sandelman.ca>; cbor@ietf.org
>> Subject: Re: [Cbor] draft-ietf-cbor-date-tag-02 - handling of time zone offsets
>> 
>> On 2020-07-03, at 12:32, Juergen Schoenwaelder <j.schoenwaelder@jacobs-
>> university.de> wrote:
>>> 
>>> PS: There are even events where there is no natural time zone that can
>>>   be associated with the event, like the first step on the moon.
>> 
>> (For those who weren’t there when it happened:)
>> 
>> Indeed, Monday, 1969-07-21T02:56:15Z.
>> 
>> Most Americans will tell you Sunday 1969-07-20 for the first steps.   The exact
>> time was actually specifically chosen to occur on prime time TV in the US (and
>> then was slightly delayed, but managed to stay in window), which spans several
>> time zones, which all have this on 1969-07-20.
>> 
>> Yes, I agree we should have some text on this (not the moon landing, but the
>> issues in converting between calendar dates and times anchored on time
>> scales).
>> 
>> 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