Re: [Tzdist] Proposal to use iCalendar format as basis for field definitions

Cyrus Daboo <cyrus@daboo.name> Thu, 28 August 2014 14:44 UTC

Return-Path: <cyrus@daboo.name>
X-Original-To: tzdist@ietfa.amsl.com
Delivered-To: tzdist@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 892331A6FD4 for <tzdist@ietfa.amsl.com>; Thu, 28 Aug 2014 07:44:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.568
X-Spam-Level:
X-Spam-Status: No, score=-2.568 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.668] autolearn=ham
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 Ss0TAl1Hbi0j for <tzdist@ietfa.amsl.com>; Thu, 28 Aug 2014 07:44:14 -0700 (PDT)
Received: from daboo.name (daboo.name [173.13.55.49]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 176F31A068F for <tzdist@ietf.org>; Thu, 28 Aug 2014 07:44:14 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by daboo.name (Postfix) with ESMTP id 32F1A7619F5; Thu, 28 Aug 2014 10:39:43 -0400 (EDT)
X-Virus-Scanned: amavisd-new at example.com
Received: from daboo.name ([127.0.0.1]) by localhost (daboo.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o4SJpdZJxJrh; Thu, 28 Aug 2014 10:39:41 -0400 (EDT)
Received: from caldav.corp.apple.com (unknown [17.45.162.46]) by daboo.name (Postfix) with ESMTPSA id E78A17619EA; Thu, 28 Aug 2014 10:39:39 -0400 (EDT)
Date: Thu, 28 Aug 2014 10:44:05 -0400
From: Cyrus Daboo <cyrus@daboo.name>
To: Tobias Conradi <tc@tobiasconradi.com>, tzdist@ietf.org, Lester Caine <lester@lsces.co.uk>
Message-ID: <FF0FFAC2A8EDF48EA8EAF2A8@caldav.corp.apple.com>
In-Reply-To: <CAAGevbX9yG8yuq1r=h0NDAMsgBbBHqtY0e6sfQWp3RDBgLLK7w@mail.gmail.com>
References: <CAAGevbX9yG8yuq1r=h0NDAMsgBbBHqtY0e6sfQWp3RDBgLLK7w@mail.gmail.com>
X-Mailer: Mulberry/4.1.0b1 (Mac OS X)
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; size="3310"
Archived-At: http://mailarchive.ietf.org/arch/msg/tzdist/0ApmClCtIzV2hqKn8ASHOD9JEak
Subject: Re: [Tzdist] Proposal to use iCalendar format as basis for field definitions
X-BeenThere: tzdist@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <tzdist.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tzdist>, <mailto:tzdist-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tzdist/>
List-Post: <mailto:tzdist@ietf.org>
List-Help: <mailto:tzdist-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tzdist>, <mailto:tzdist-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Aug 2014 14:44:19 -0000

Hi Tobias,

--On August 27, 2014 at 6:06:23 PM +0200 Tobias Conradi 
<tc@tobiasconradi.com> wrote:

> I propose that any tzdist specific fields that refer to one time zone
> are defined in the iCalendar format as defined in RFC 5545
> http://tools.ietf.org/html/rfc5545 .
>
> I propose to use
> X-TZDIST-
> as prefix for tzdist specific fields.

If it becomes necessary to extend VTIMEZONE to support additional meta-data 
that is fine - but we should do so with properly registered properties not 
X- ones. In fact the current spec already does register one new property 
(in Section 8): EQUIVALENT-TZID.

> That ensures that the charter requirement
> https://datatracker.ietf.org/doc/charter-ietf-tzdist/
> -------------
> The working group will work under the following parameters:
>
> - The time zone data distribution protocol will initially be targeted at
> iCalendar-based clients
> ---------------
> is fulfilled.

I also want to point out that VTIMEZONE has limitations on conveying the 
underlying tzdb rules in its own RRULEs. There are some rules in the 
current tzdb that cannot easily be represented in VTIMEZONE in a way that 
makes the underlying tzdb rule obvious. To illustrate, consider the 
following:

- For America/New-York the current VTIMEZONE RRULE for the transition to 
standard time is:

RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11

and the equivalent tzdb rule is:

Rule	US	2007	max	-	Nov	Sun>=1	2:00	0	S

So there is an obvious mapping for "first Sunday in November" between those 
two.

- Now consider the tzdb rule for Egypt:

Rule	Egypt	2014	max	-	Sep	lastThu	24:00	0	-

That is "midnight - at the end of the day - for the last Thursday in 
September". That can also be translated to "the 00:00 on the Friday after 
the last Thursday in September". That exposes the problem - because it is 
possible that the Friday is actually the 1st October if the last Thursday 
in September is the 30th. That "bumps" the recurrence into the next month. 
That makes it impossible to use a BYMONTH type component in the iCalendar 
RRULE. Instead, the tool I wrote had to generate this (*):

RRULE:FREQ=YEARLY;BYDAY=FR;BYYEARDAY=-92,-93,-94,-95,-96,-97,-98

That basically matches the tzdb rule by targeting the week, offset from the 
end of the year, where the observance should occur and picking the day 
within that week. There are other ways to represent that (e.g., usiong 
RDATEs for the exceptions where the Friday is in October and breaking up 
the RRULE into segments in between the RDATEs, but that can only be done to 
some finite point in the future).

Obviously that RRULE now looks nothing like the original tzdb one. So I 
would be very reluctant to consider iCalendar as a possible "canonical" 
form for the tzdb.

(*) I should point out that my tool does not generate the BYYEARDAY rule 
any more. We discovered that another popular iCalendar library does not 
allow the combination of BYDAY and BYYEARDAY parts (even though that is 
legitimate according to RFC5545). To work around that I "broke" the rule a 
little bit by having the transition occur at 23:59:59 on the Thursday, 
which did mean I could use a BYDAY/BYMONTH RRULE. Whilst not ideal it is 
something we are willing to live with in our product until the problems 
with the other library are fixed.

-- 
Cyrus Daboo