Re: [Sedate] Can offsets like [+02:00] be used instead of IANA names in brackets?

Justin Grant <justingrant.ietf.public@gmail.com> Tue, 08 March 2022 20:58 UTC

Return-Path: <justingrant.ietf.public@gmail.com>
X-Original-To: sedate@ietfa.amsl.com
Delivered-To: sedate@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C8AA63A0C9E for <sedate@ietfa.amsl.com>; Tue, 8 Mar 2022 12:58:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 ZPajWVqsOkri for <sedate@ietfa.amsl.com>; Tue, 8 Mar 2022 12:58:17 -0800 (PST)
Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1FF263A0D05 for <sedate@ietf.org>; Tue, 8 Mar 2022 12:58:17 -0800 (PST)
Received: by mail-oi1-x22a.google.com with SMTP id x193so642405oix.0 for <sedate@ietf.org>; Tue, 08 Mar 2022 12:58:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ne6Ig2ZNxMQ0qWipuatX3eAU3EHkVrX2FIY2st/NK9A=; b=gESI/70PNS9lzTHt6GaXs9ddIPIRpw2cPzyl279nA1EypN64Stk3d0DYp1usJftGQA 8ZfBLc0H3l4tW1rMXbzK93zeYvzujUHdgI//rylGWhW4CZJmvBs7UOH4xSpddXVG1ULi XQWerZjp0IEYekOVvpeaS+ug0Es9nVdPz/z76T9vLm7Vkqp21yl+dQ1AF6IPjJM8nSX0 xfmVwSsLLJbNTbeAtC1EjIkiuoJgpVJm3ppjWtGlEbxv0yTIFC8Kgc76xG3nET7SJz1q fV8H0/1/IlvO9Chs6n9+Qu51LkwXrIOGr0wxjwd3fms271G7NRHgFGsGV/Aq2pEPoWDi l0Cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ne6Ig2ZNxMQ0qWipuatX3eAU3EHkVrX2FIY2st/NK9A=; b=iNOgp9kpyK3ho7tRlqegx0B+oM+OJ4ZVkuYosJa2NVP3e8ib30gG0ZSFTic0da5729 5I/YGEU7SgIGfvp7Cj6ycnDGitjv54Ktjbpnd3sB/uIrbNMuVnhlxG75wod75+nCUF+0 RmOoKUeaOj9SDSlemB4KBErd8+e+XbbilDuPeHo/7QdymIrAtHeR6X52MKEP5vkrl9Lg 7goQTGIK0vS2MlLm6Rpn/hAnX+FtaYJcjkWLWGOVnCQXJdq3kowckc3cJ0WClE5atcq7 co4WjS9yxJbeX8UUHnhyfVlhbZ2frHlxcS1z8wTFGmadTjNhh4IKBoclWUs4TbhN9b7n bDGg==
X-Gm-Message-State: AOAM532u+cMkT8SGJIiaqMjmPR/ZPQgnuI4fsmPOmjc+1/ms/VnmPqxw EWilOURmi8Dd1sSKsBGMPpGiiQSy9wTS2c91S24=
X-Google-Smtp-Source: ABdhPJz7ccke4CP9T/cN3No+7ta6rGF++ucHOLu1CC+EPYWn+BLCtLjGY3F9/x9d6anfEEWFCf0XVWzPt88muqSEIRE=
X-Received: by 2002:aca:ef45:0:b0:2cd:7fa2:c0a8 with SMTP id n66-20020acaef45000000b002cd7fa2c0a8mr4131829oih.6.1646773095268; Tue, 08 Mar 2022 12:58:15 -0800 (PST)
MIME-Version: 1.0
References: <CACy7CfhB63dgxatWHYSr-KMKP1SWwd6nRmumCSCPVijgYede4A@mail.gmail.com> <c8035af7-1302-a04a-e449-76db3ad1754e@igalia.com> <6D38910C-72A3-4133-A9BF-794B532765DF@tzi.org> <CACy7Cfgw42p4e0squf0=Ji=RPau+ASeTWd=D6syK5=WUXpfvDw@mail.gmail.com> <A5B6B601-F5B1-469F-B442-3D008519D24B@tzi.org> <CACy7CfhxiOOy0BMdAgx2Jaiomnq6GvEqhamUmOwgdWB6oyKY3w@mail.gmail.com> <63BE08D0-C7C5-4CEA-BBE2-640C8F126661@tzi.org> <f6645a58-74f4-31f4-edd7-85d3d1b91851@igalia.com>
In-Reply-To: <f6645a58-74f4-31f4-edd7-85d3d1b91851@igalia.com>
From: Justin Grant <justingrant.ietf.public@gmail.com>
Date: Tue, 08 Mar 2022 12:58:04 -0800
Message-ID: <CACy7CfitzT5qDh68P5ZBRDSMAKwSWozWgg9yTJAT2AX9S_VD_A@mail.gmail.com>
To: Ujjwal Sharma <ryzokuken@igalia.com>
Cc: Carsten Bormann <cabo@tzi.org>, sedate@ietf.org
Content-Type: multipart/alternative; boundary="0000000000005e852505d9bb3d40"
Archived-At: <https://mailarchive.ietf.org/arch/msg/sedate/4LaNbiNVYuZFMykcEcqZIQWMnn8>
Subject: Re: [Sedate] Can offsets like [+02:00] be used instead of IANA names in brackets?
X-BeenThere: sedate@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Serialising Extended Data About Times and Events <sedate.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sedate>, <mailto:sedate-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sedate/>
List-Post: <mailto:sedate@ietf.org>
List-Help: <mailto:sedate-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sedate>, <mailto:sedate-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 08 Mar 2022 20:58:22 -0000

The purpose of the time zone extension is to allow senders to tell
receivers about the time zone of the timestamp. A timestamp can only have
one time zone, so therefore there should only be one time zone extension.

An IANA name in brackets means "receiver, please use your TZDB rules to
decide how to calculate the offset of derived timestamps like "1 day later"
An offset string in brackets means "receiver, I am opting out of using time
zone rules. Instead, every derived timestamp should use this offset."

A good question is why not just use a bracketless RFC 3339 string to
indicate opting out of using TZDB rules?  The main reason is that it'd
unnecessarily break compatibility with existing Java code.

But there's another reason too. Programs that create DST-aware derived
values (e.g. "one day later") from an input string should require bracketed
timezone annotations and therefore should fail parsing if the annotation is
missing. Doing this ensures that senders won't inadvertently pass an RFC
3339 timestamp (with no awareness of its time zone) to a program that needs
the time zone to calculate derived values.  But if the sender wants to opt
out of time zone processing, then using an extension like [-08:00] allows
that escape hatch without opening up the receiving program to bugs caused
by senders accidentally omitting the time zone annotation from the string.

Note that offset time zone annotations won't be a common case. It's an
escape hatch for cases where the time zone is not known, and when the
sender wants to tell the receiver that they're OK with it being unknown.
Had Java not accepted this syntax we probably wouldn't add it, but given
that Java does support this syntax and it's been in wide use for 10+ years,
it seems prudent to accept it in the standard.

Cheers,
Justin

On Tue, Mar 8, 2022 at 12:56 PM Ujjwal Sharma <ryzokuken@igalia.com> wrote:

> I believe the Java format only allows one bracketed suffix, but also it
> won't be quite useful to have two conflicting pieces of information.
>
> Why *did* Java support offsets in the brackets, however, is not known to
> me. Perhaps we could ask Stephen Colebourne
> (https://twitter.com/jodastephen)?
>
> Ujjwal
>
> On 09/03/2022 01.50, Carsten Bormann wrote:
> > On 2022-03-08, at 21:19, Justin Grant <justingrant.ietf.public@gmail.com>
> wrote:
> >>
> >> IMO, "second exception to the [foo=bar] syntax" sounds like
> [-08:00][America/Los_Angeles] could be allowed in a string, when in reality
> the time zone suffix should be mutually exclusive: either an IANA name or a
> numeric offset string.
> >
> > Ah, that’s the part I missed.
> > So what is the reason these are mutually exclusive?
> >
> > Grüße, Carsten
> >
> >
>
> --
> Ujjwal "Ryzokuken" Sharma (he/him)
>
> Compilers Hacker, Node.js Core Collaborator and Speaker
>