Re: [Cbor] Proposal for Date, Time and Time Zones

Richter, Jörg <Joerg.Richter@pdv-FS.de> Thu, 14 February 2019 14:55 UTC

Return-Path: <Joerg.Richter@pdv-FS.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 9F392131069 for <cbor@ietfa.amsl.com>; Thu, 14 Feb 2019 06:55:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.921
X-Spam-Level:
X-Spam-Status: No, score=-0.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FROM_EXCESS_BASE64=0.979] autolearn=no 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 jhYNJhRz8qzu for <cbor@ietfa.amsl.com>; Thu, 14 Feb 2019 06:55:36 -0800 (PST)
Received: from mail.pdv-fs.de (mail.pdv-fs.de [213.208.220.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 90F5413104B for <cbor@ietf.org>; Thu, 14 Feb 2019 06:55:36 -0800 (PST)
Received: from EXCHDB1.pdv-fs.de (192.168.180.94) by EXCHDB1.pdv-fs.de (192.168.180.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 14 Feb 2019 15:55:34 +0100
Received: from EXCHDB1.pdv-fs.de ([fe80::6c4a:8b1b:60f4:4437]) by EXCHDB1.pdv-fs.de ([fe80::6c4a:8b1b:60f4:4437%15]) with mapi id 15.01.1466.012; Thu, 14 Feb 2019 15:55:34 +0100
From: "Richter, Jörg" <Joerg.Richter@pdv-FS.de>
To: Carsten Bormann <cabo@tzi.org>
CC: "cbor@ietf.org" <cbor@ietf.org>
Thread-Topic: [Cbor] Proposal for Date, Time and Time Zones
Thread-Index: AdTEOszvWqEfqmNWRgi+93eO+W0ZPwACs1MAAAYxEOAAAW+WAAACzE+A
Date: Thu, 14 Feb 2019 14:55:34 +0000
Message-ID: <0505e72f187943949ce840d90f6dfaf3@pdv-FS.de>
References: <bd4d7f87e98b40d585eb7b4502d4b234@pdv-FS.de> <5105F5B3-258E-44B4-B756-2444BB336845@tzi.org> <151a780241b54397bdcdaf06d04668b1@pdv-FS.de> <D6578BB5-289A-46F8-9019-7DCF2F470FBC@tzi.org>
In-Reply-To: <D6578BB5-289A-46F8-9019-7DCF2F470FBC@tzi.org>
Accept-Language: de-DE, en-US
Content-Language: de-DE
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [192.168.180.93]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/WTRGRbv-99yH2t5ByY7kPw-oDJI>
Subject: Re: [Cbor] Proposal for Date, Time and Time Zones
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: Thu, 14 Feb 2019 14:55:39 -0000

> Yes, but they save having to combine full seconds and decimal fractions
> into a single number, which would be needed for bigdecimals (CBOR Tag 4).
> Many UNIX times, as well as the Haskell time which actually motivated
> writing the draft, come in seconds/decimal fractions.

Ahh okay.  Seems like I have misunderstood this usage.  We always have
our seconds and fractions combined.  

> If you don’t have split seconds/fractions, you can use Key 4.
> If you do, and want to preserve the split, we could introduce Key -7.
> Is that a common representation?

I think not.

> I’m familiar with using 10 MHz clocks for frequency references, but wasn’t
> aware of its use for time reference.
> You could also use Key -9, at the cost of one multiplication by 100
> (encoding) or division by 100 (decoding).

We considered this, but then 64 bits are not enough for the time span we
want to support which is around 10000 years.  And multiplying by 100
will result in a bignum instead of an int64.

> Tag 0 and 1 use civil time, i.e., time based on UTC.  For Tag 1, this uses
> the weird Posix format where a leap second and its preceding second cannot
> be distinguished. 

Okay.  Then this is what we use.  In my opinion this is more practical useful.

> For Tag 1001, we intend to have a map key that indicates the time scale,
> which would then clearly include TAI as one option.  This is not in the
> draft yet because we want to discuss this with an actual user of atomic
> time.
> We also have some quite positive feedback for including leap-second
> smeared time scales (but which ones?) as further alternatives.

I think time scales that avoid leap seconds will always be preferred. 
Unfortunately I can't be of much help because I don't know much about it. 
By "avoiding leap seconds" I mean that the UTC-day can be easily computed 
by dividing by 86400.

> Again, we would like to nail these down based on input from actual users
> of the concepts of duration and interval (including their thinking about
> semantic dates and concepts such as leap seconds and time zone changes).

I don't know if it's any help, but there are other types we use:
* time duration in fractional seconds
* UTC offset in seconds (like +01:00)
* period of time (like "3 months" or "7 weeks"). 
  It consists of two parts. A whole number and the unit.
* and any element of a date like "year", "hour of the day" etc.

But for now we don't need tags for those.
And we "ignore" leap seconds, like all other systems our product connects to.

Some other points:
I think I will extent the proposal for time of day to include decimal fraction.
Is it possible to extent Tag 1 to also accept decimal fraction?

- Jörg