From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MJa2AM0NaWClYAEAgWs5BA (envelope-from ) for ; Sun, 04 Apr 2021 02:52:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ECMEN8wNaWAGegAAB5/wlQ (envelope-from ) for ; Sun, 04 Apr 2021 00:52:28 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4B1F01B015 for ; Sun, 4 Apr 2021 02:52:28 +0200 (CEST) Received: from localhost ([::1]:45094 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSr06-0000t5-9P for larch@yhetil.org; Sat, 03 Apr 2021 20:52:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSqzH-0000sh-A1 for emacs-orgmode@gnu.org; Sat, 03 Apr 2021 20:51:35 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:37689) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSqzE-0001Ky-LF for emacs-orgmode@gnu.org; Sat, 03 Apr 2021 20:51:35 -0400 Received: by mail-wr1-x42f.google.com with SMTP id x16so7828908wrn.4 for ; Sat, 03 Apr 2021 17:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BfSt6qM0m6qWCAXcOlceYUH/bIDxnNJWnIR1qMsq3sA=; b=bOlsVa7Lg4nvWva+5vXC8QKYoZHD3YkvXA8YF0jLfPQn27pC9XoAeEbG4Sz3Mytz8F hoauOnNt6W5yC3Drlzf1iPQFf3nVIJ2IfstIb4by8+/oen4XKv04ioKMqFgmoA7xxj6E Dh8W3nzqy3PQuStjQ42gHg/l2j5YUFuC1JADNueKmmG1J1UA90Cwz7CoUmYWfaXmqeeU XgQYrPs1Apo2D+1KeL7m+7jKLHGEYe9gWOqSDMJQnvcekmUWppPH6W43hInG8hypEGA9 AOqGuoodsb/soTOfF3mNJEZm8wVSgrjtMEigN005zxAdPzcFY4IvT71inS5QXiAJy6a4 IRCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BfSt6qM0m6qWCAXcOlceYUH/bIDxnNJWnIR1qMsq3sA=; b=MFEssJ9G+TI9GSEETURxhFkyAcmZkvMheAB11CFnHkjN2Vg5p3SZs6BXgUD+6egMT0 auxj7UQ0uP7Sses03KbPggJvhTVrmiRDvrIEv+4HtPw5xGP988GDFqU7RZB2ydv8Ijjr prtAdRICliB5KDYpLzj/z2P/Y/u7sSbEaDz2tmaFKramaRTNkY/IlGfe06ReRQTCsKEW 6wfsOOZyTfVAcLvbadWyC11lNGzL8JKGqYF9PCR13wU0O0/trdiRv1Qj04Vb664xrI5h /hHSzsTpkHkwuswaYoqAOr/DHsQwKmoeArZLQkuQvOaVqpg3emdmP7gQSPMiR9jdWDDN O5WA== X-Gm-Message-State: AOAM530wzR/7OQX1+MQYC+TaYrUZteVxBDPvYKPVdpa/vedmT1leiBnV J+tMXuIIaIHwfDZRyZADNwWVljPnEnds+DRwrd0= X-Google-Smtp-Source: ABdhPJw3WIA/fGJIGBm52Jfegym6s0ZiWoo1pKyw4OC8NH7tRfKrcTfb/xSvg49v2e/RKDJrBXLSL3HgKsHrYUFXrK8= X-Received: by 2002:a05:6000:18d2:: with SMTP id w18mr22157591wrq.88.1617497488920; Sat, 03 Apr 2021 17:51:28 -0700 (PDT) MIME-Version: 1.0 References: <20210403150042.GK27597@maokai> <701561.1617475882@apollo2.minshall.org> <87y2dz54sk.fsf@gmail.com> In-Reply-To: <87y2dz54sk.fsf@gmail.com> From: Tom Gillespie Date: Sat, 3 Apr 2021 17:51:17 -0700 Message-ID: Subject: Re: Idea for handling timezones To: Tim Cross Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617497548; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BfSt6qM0m6qWCAXcOlceYUH/bIDxnNJWnIR1qMsq3sA=; b=KOBPWeMo/qPkZ1sluvGklTNc6CXwX7UiHblbV8+wcSEQ6aYp9Sfaz/7fSpSqd1GZfJESx+ FcaVpSUCxmrNoJdP0n2rMsvoIHKzZVUDj/+IRchXLczgIiCgjesjUFTKyTTjjxswsIPOC6 WjDiFFcqBd07FFgYXjIkutUdQtP//5pULC1H7JoMglgSSrehN002DV0LX7iJtsdgy1rixx oIV2nr6YR7OXBMAky697vpDhi0dw71EjHGHntgVu7iKSiVJ0eMLVcMgJ+MfdepWdJTXL5+ FYyqFyZ3sZTTUGhtJ6ZMWK5ZS/PsX9XYg8wgBTZNarjfQp6nQMPuVtIXdAaPHw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617497548; a=rsa-sha256; cv=none; b=FxJab82korFxHT+bvmt2MYlt2j25eEYgYm6umuEnPb+sf929rRzDZZYZvmEpJ0soerPwc8 bge1trMdA5zs28E4QnG+qGjHKLbz66UhujOUTb4OZsPXbOVCIFHktqA+n4g+06xI4NY7sk it2stMoONg6mQwjBtRD7O8faLz1YDXa00Nu3piqxfZFpYTyYRm+B+zUYZegPTG2oBNVhqe dYD0cc/7uzm056aZycve35GHnLThEzAc7ZaqlfEnUHjGSAiHTv/Kdw38g+rAdJ2Sn7GiIZ RnmqaKU9AkiWObPldoNWwnarEslvlMheXNgGUDEJzIqNNSOOxzVdy6ZIuAxZWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=bOlsVa7L; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=bOlsVa7L; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 4B1F01B015 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: Wh5fpS+vDglJ Time zones are tricky, but there are some requirements that make it possible to rule out many apparent solutions because they violate some critical invariant. For example. Timezone cannot be scoped to the file. This is because many users (myself included) have a single org file that is used in and across multiple timezones. Thus the original proposal in this thread to have a #+timezone: keyword is insufficient for many use cases, and can lead to significant confusion and bad data. Similarly it is probably a bad idea to always use UTC because even though it will technically always be correct (while on Earth ...), it means that the user will need to have kept track of their spatial coordinates in addition, and in addition there will be an eternal dependency on the timezone database in order to correctly reconstruct what the timezone would have been. All in all it is better to assume that the user has correctly configured their clock for their needs, and record the timestamp with timezone offset (NOTE textual timezones cannot be used in timestamps for a variety of reasons not the least of which is that they are ambiguous, see CST for example). Sadly, the ISO8601 timestamp specification for a negative timezone offset uses a hyphen minus, the same as the date separator, so that baggage is going to be with us for the rest of time (at least until someone comes up with something better than ISO8601), but at least it requires no additional information to capture all the information needed to correctly reconstruct the time that it stamped. Finding a timestamp format that has a regular grammar, is invariant to changes in the location and time of the user (What if the user is on Mars? What happens after year 9999? What happens if someone needs to reference a date in the far future? What if someone wants to mention a historical date e.g. 1000BCE?), doesn't require external information, and is also somewhat human readable, is a major challenge. If we could serialize something like the unix epoch into a file and render it differently in the buffer that might work, however that defeats one of the major points of using org as a plain text format. My proposal at the moment based on the constraints imposed by the current timestamp format that includes the repeat or delay syntax would be the following (date and time and day are separated by a space) date: ([+-][0-9]\+|[0-9]{4})(-[0-9]{2}){2} time: ([0-9]{2}:[0-9]{2}(:[0-9]{2}(,[0-9]{1,9})?)?[+-][0-9]{2}:[0-9]{2})? day: ([a-zA-Z0-9]\+)? followed by a space and then the repeat or delay for example [+10000-01-01 10:11:00,992315771-04:00 Sat] or [-480-08-20 05:00+01:00] or more temporally local [2021-03-03 17:43-07:00 Sat] This is the closest I have been able to get while working through formalizing all of org syntax and trying to come up with more robust solutions for timestamps. For comparison see org-ts-regex and friends in org.el. I have also not come up with a better solution for the repeat or delay syntax, though ISO8601 interval specification might be an option. Similarly there are extensions for dealing with uncertain dates and times, but I don't have good proposals for those right now, and the use cases are also somewhat out of scope. Best, Tom