[Sedate] A syntax proposal: floating and future times

Bron Gondwana <brong@fastmailteam.com> Sun, 07 November 2021 03:16 UTC

Return-Path: <brong@fastmailteam.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 AEEBE3A0E2C for <sedate@ietfa.amsl.com>; Sat, 6 Nov 2021 20:16:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.119
X-Spam-Level:
X-Spam-Status: No, score=-2.119 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, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fastmailteam.com header.b=pzCc3N2B; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=mEiNRWI5
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 O4MB-nzyUfNH for <sedate@ietfa.amsl.com>; Sat, 6 Nov 2021 20:16:35 -0700 (PDT)
Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 718783A0E2A for <sedate@ietf.org>; Sat, 6 Nov 2021 20:16:35 -0700 (PDT)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A8AD85C0125 for <sedate@ietf.org>; Sat, 6 Nov 2021 23:16:34 -0400 (EDT)
Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Sat, 06 Nov 2021 23:16:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= fastmailteam.com; h=mime-version:message-id:date:from:to:subject :content-type; s=fm1; bh=ofk1FjqTLpjvCerJzEzFIkRA75+STH+vqYPJdf4 me7I=; b=pzCc3N2BJFP5uykpu5TTGBV9ondPdPsQwwEV9+gqKKwSLv+TLpEog6r tr6fl3wRgqtbUewXsASQde3Ioun6yvaoSTrR2r6DnIeDHi3vZhYDdJXU9I/ustQv 0sIye7/um45lDoRxSvBYA+xwM8r/npvOF9mZmyTwD+uS/T+Dg0oURyufibOKRHsK jyAer3EIagUycZ0w3ZyhddPEz+aiGc7xkOeV+PWzmpEx75SKmSSm9KVPY1AtQbax IgsXWcPC/2AOZX/Yn7nRERQL2FFzmWre1wYXJ7QKmickBCB9HmLH5tcqGfPNGz06 1TSFdKpGkBGIU8nu9nueH8z6XHLwAPQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=ofk1FjqTLpjvCerJzEzFIkRA75+ST H+vqYPJdf4me7I=; b=mEiNRWI5RKpZU1tscMweJcBEs5nzSr5TJ6G9Id+t10jjd XFHEgjA8SQPuEgG7V6PVE5D5F0I1oFjSARXf39/zTuB0lXarEtQUP3GRVDHF9MAO 0qNkbCTRKw2DHxz93gWKPRw5PY0d5wRBd2kHJtu6p8K0xK8OBlFjpuDlCIuLphHz cSheF3hEF/UCd3+XeoXtfon2ERuNL6WqqGCd0JbHQL+3KRevBSnxyJ9MG0swHJrg 9hrhXZW1J76eSrt8kwfdGTJQnUdHXaGlnONga8hNfiRGKNql/fmQLSghebzdcUlZ k1e9CTImrCL85u8DEe4zK2TSFlCW1BRf5Om0F/rvA==
X-ME-Sender: <xms:EkWHYWYPcJNk9jUOn7dSbEMrNvwJ6XGqApKiQjlqLju0ONkuKtaG_A> <xme:EkWHYZZOimJ7ggB382iqUfQQ1XFJC4Tbowcbqjp30O1lODs7FrHjNAFxQK9JgD9Wf vAFvNbPSlw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdelgdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesrgdtreerre ertdenucfhrhhomhepfdeurhhonhcuifhonhgufigrnhgrfdcuoegsrhhonhhgsehfrghs thhmrghilhhtvggrmhdrtghomheqnecuggftrfgrthhtvghrnhepvdetteeiveeihfegie dtgeeigfduveelhefgffelgeelueehhfeitdelgedtffegnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsghrohhnghesfhgrshhtmhgrihhlth gvrghmrdgtohhm
X-ME-Proxy: <xmx:EkWHYQ-SJrU1wwILUbhDJmdPxmi0EWl1YCArAoYGpI84Jcfqh0W7yQ> <xmx:EkWHYYoWXbX7Q1Zjc395YYMPlxeYPWsKq5LYB4VCynexqPveD4ZGag> <xmx:EkWHYRpZXoogDhc9r6Iq8xi48txBMqA-_IT5zdESaLMI9F4_vzNzSg> <xmx:EkWHYe3AELuW_jEnOSvgt3fPcNNvnGajpczVHfgVmJuOJHi-Vw85pg>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3978CAC0DD1; Sat, 6 Nov 2021 23:16:34 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.5.0-alpha0-1420-gdf09e8761c-fm-20211101.001-gdf09e876
Mime-Version: 1.0
Message-Id: <dd7c1028-09bc-4839-b6d4-68e14e99b349@dogfood.fastmail.com>
Date: Sun, 07 Nov 2021 14:16:13 +1100
From: Bron Gondwana <brong@fastmailteam.com>
To: sedate@ietf.org
Content-Type: multipart/alternative; boundary="920654f63e2e4d8ca8a7fb2aa382ee18"
Archived-At: <https://mailarchive.ietf.org/arch/msg/sedate/BM2vUOow4WUAz-3JaXwKvd6iq2k>
Subject: [Sedate] A syntax proposal: floating and future times
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: Sun, 07 Nov 2021 03:16:41 -0000

One of the biggest areas of debate in the meetings so far has been how to handle a mismatch between the zone and the offset, and whether to allow floating times.

I've had an idea in my head for a bit, so I figured I should write it out in advance of our meeting next week!

The basic principles are:
 * the special name 'floating' is used to specify that the timezone will be resolved at the point of display or use
 * the zone in brackets is advisory only, the offset always wins
 * the namespace 'tz' specifies a timezone which overrides the offset.  That means that a time with a 'tz' namespace may be different than timestamp defined purely by the RFC3339 part, thought it's recomended to use the best-guess at what the offset is likely to be in the timestamp, so that systems which don't understand this extension still give as good position as possible.

My example timepoint will be 9am on my birthday - not this year, but next year - giving enough time for some likely changes to happen.  So that's

`2022-11-26T09:00:00`

I expect that I'll probably be at home when I create this, so by default I would create one of these:

`2022-11-26T09:00:00+11:00`
`2022-11-26T09:00:00+11:00[Australia/Melbourne]`

These both mean `2022-11-25T22:00:00Z` and always will, no matter when they are resolved.

*Changes to zone offsets**
*

Let's suppose the the Victorian government decided to join with Queensland and stop doing daylight saving next year, so "Australia/Melbourne" would then resolve to +10 in late November.  I could use this syntax:

`2022-11-26T09:00:00+11:00[tz=Australia/Melbourne]`

Which would start out as `2022-11-25T22:00:00Z` still, but would change to `2022-11-25T23:00:00Z` once the local zone database was updated.

*Floating time**
*
**
Suppose I just wanted to know when 9am was on my birthday, wherever I am in the world.  I would use something like:

`2022-11-26T09:00:00+11:00[tz=floating]`

(I'm happy bikeshed alternative syntax, e.g. `[tz-floating=true]` - just a clear way to specify this concept.  An advantage of having 'tz=' for both is that the "closest bound wins" rule applies - and you don't get confusion if both floating and a named timezone are specified on the same item - the first one always wins)

So if I'm still in Melbourne for my birthday next year, then it's the same as one of the above examples, but if I went to IETF115 in Madrid (assuming we go there for November next year!) and wound up still in Europe for a few weeks after, then it might resolve to `2022-11-26T08:00:00Z` for me, because I'd only be one hour ahead of UTC.

*While we're at it, what about TAI?**
*

Maybe I care about the alignment of the heavens at exactly 9am on my birthday being exactly 31536000 seconds since 9am Melbourne time on my birthday this year!  Maybe I could write:

`2022-11-26T09:00:00+11:00[tz-tai=37]`

Where 'tz-tai=N' defines the integer TAI offset that was expected to apply at the time.

Then if a leap second gets added or removed at the end of this year, this could resolve to a UTC date of:

`2022-11-25T21:59:59Z` or `2022-11-25T22:00:01Z`

(either way, it's the same TAI date of `2022-11-25T21:59:23`, regardless of leapseconds)

Obviously - these could all be stacked and the rules would be very clear about what to do, though it would be pretty weird to care about the exact TAI offset but NOT the exact UTC offset.

...

I think this is all consistent and easily implementable.

In particular, it creates clarity around handling:
 * If you specify an unadorned timezone, then the timezone is advisory and the offset always wins.
 * If you specify anything with the 'tz' namespace, then the offset is advisory and the timezone information overrides at the point when the date is resolved.
 * If the timezone can't be resolved, then the offset can be used as a fallback - so implementations SHOULD use their best guess as to the offset that is likely to be meaningful (e.g. local timezone of the user or system that created the date)

Regards,

Bron.

--
  Bron Gondwana, CEO, Fastmail Pty Ltd
  brong@fastmailteam.com