From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id t00YLMqxZ2BfhAEAgWs5BA (envelope-from ) for ; Sat, 03 Apr 2021 02:07:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EPw3JcqxZ2DzYQAAB5/wlQ (envelope-from ) for ; Sat, 03 Apr 2021 00:07:38 +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 DDD9CBAF3 for ; Sat, 3 Apr 2021 02:07:37 +0200 (CEST) Received: from localhost ([::1]:60584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSTp9-0000xX-Q5 for larch@yhetil.org; Fri, 02 Apr 2021 20:07:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSToe-0000xL-SU for emacs-orgmode@gnu.org; Fri, 02 Apr 2021 20:07:04 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:34335) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSTod-0000Du-0v for emacs-orgmode@gnu.org; Fri, 02 Apr 2021 20:07:04 -0400 Received: by mail-pj1-x102c.google.com with SMTP id cl21-20020a17090af695b02900c61ac0f0e9so6757655pjb.1 for ; Fri, 02 Apr 2021 17:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=ijJlN4AjcILpUta0n6IeMd2YK4a4b4lmQSrgGOiA5Lg=; b=sCT0TA9LqjuTAb9nezRqWKPR0ysQucsn4Jym8PlfIXG01nbCEaHe+G2BQn9vCRlx1Q 78VrpLbDc0hJrkXAgqv7VjdwFZboMV+4jVz0PnwibeRmjVhkELq9XYup2/JiVhUcUDkP uQh1Z+QQpZTD0Z5kaP1UbdTnkS45/sstJARNZschTj8fN0PouYv6XKO3IN816RPCPeWN f2KJzTDn2GGdtdgN1nKK1Ok7xXsMGJXM/htllUNSyskQa17TtsgI4XflP22NOJOibxGQ eNNhN8vylp0KYbhIUboJamfU3Cvvy1NrJyPyiTHmV+mpz1UtpBcWMHevQmxh5aYn1AaC 4kpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=ijJlN4AjcILpUta0n6IeMd2YK4a4b4lmQSrgGOiA5Lg=; b=GPJB91oUPuqU5Drj7g4yby9Qb55xqJ0K1DLlccVIrEMXM0T2WojI4JYeBpAdW67NEQ VxOanIFfYhZkZ8PnFcU2xVQlPa/Q6EaTHuytwVY49AytpfXScUaFVkDDnZ5m6UwB7fu2 54Kp8IwP88Qu0TJF+/j3zzo72OomKuql7O/v3sGC8568PiAJINNSd05NTPwJOGkAfCT8 ipjNT9lj9QcDNI2Bh1sf1S10nmtBQ23Ms3896fbU0afTrpM7/cyKdujYXlje70rHkwbm xqlKrbaKgpOhazVDR2vtzEgUywxbNruFWB9SWF7mGBJvbdIFWm7EJOycIyHStksCiKRc 7gOA== X-Gm-Message-State: AOAM531quEl4OCGAutsCGbZNZx1V1/M90Stm4F5OHw+JnSrdWbBl9m3p Dcl3VsRZtK+x7WIj+gvjIYNoMA07tLY= X-Google-Smtp-Source: ABdhPJxnLaKQ4yOc7Q9j5VMgIGT60/z6xrUy2AehvUmy5x0O/W3S2ybR8zip6XlfwldlFeAsnKjMsg== X-Received: by 2002:a17:902:a502:b029:e8:3a40:bc6d with SMTP id s2-20020a170902a502b02900e83a40bc6dmr12738921plq.14.1617408420835; Fri, 02 Apr 2021 17:07:00 -0700 (PDT) Received: from tim-desktop (106-69-76-38.dyn.iinet.net.au. [106.69.76.38]) by smtp.gmail.com with ESMTPSA id w26sm9297150pfj.58.2021.04.02.17.06.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 17:07:00 -0700 (PDT) References: User-agent: mu4e 1.5.11; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Idea for handling timezones Date: Sat, 03 Apr 2021 10:37:22 +1100 In-reply-to: Message-ID: <87blawgrj3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x102c.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: , 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=1617408458; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=ijJlN4AjcILpUta0n6IeMd2YK4a4b4lmQSrgGOiA5Lg=; b=Hu/sW7N2dFu+BlDgNIKPs5CVel6Xf2wyifK19TLry+UBA/b/8ctxFEF3frUh2YoU7XweUc jrFmNDcJ7S7wNjErcbxrHGKp1J8jRe4o2mpF8wZQlR7n9jJYxMUfbmEFHtXnL6+cvCr/Zf lXbVyDSKJqfmDrOQy0PkN9u8l3Obn8G2GRVPkeiVprNcfNrCucQejdtZfHI0qs2maBQSj5 e95SWDU8XjGwza4hfFWL72j3dvrydIntZpPseDGptcvmpFeycacs6HIaxmPfv42UacsYeL PJ/d/N9SGKgGSwIcE776Z/I5/dx+ZVoLrsBJfpJ9CK1ns0SqTTK4d29c9MJKYg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617408458; a=rsa-sha256; cv=none; b=a6dO1sLZUjpmOkuXySjXSB27PplwO1DfVmG7KzV5t6W58/2ucv6gvKjm/uaBj50xHiRbBG pV3LRYYCf8ilA4kym9Of6tPBKdwUY6q5K4iPsMakNKRpN3bNgUx/dEBxR4ubhtR+khXg2+ Qf7Y8A7JB6N1k5Rewh7N6NaBy5dNZkkXLAWSfV6s1LChA7zKGn5rW4pUXoJ1afx4cwfTYn 0Za0yJK/O9fgQTMCVcbikKKQkfByDTtC6s1kTrpeqsDVZ4u8lpSd3tBGY71RS45P2GOha6 VLqMpKfjEdZ26zOBtUqSnC8V0tN42duUYMA8LXOrzKThy63x6n5XNR2u1cjE7A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=sCT0TA9L; 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=sCT0TA9L; 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: DDD9CBAF3 X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: BRMluDsvUj3x shironeko writes: > Hi everyone, > > I, like many others on this list, have to move between timezones quite > frequently. As I gathered from the archive, it seems the main complexity in > supporting timezones is the difficulty revolving the change of timestamp format. > So I have an idea, suppose we add a new keyword, "TIMEZONE" that can be set at > the start of the file like so > > #+TIMEZONE: America/Toronto > > This specifies the timezone of all timestamps in the file. Together with it, > there can be a function called e.g. org-shift-time, that shifts all the > timestamp in the file to another specified timezone and updates the keyword. Of > course, care needs to be taken when dealing with dates without time, e.g. it > should be treated as at time 00:00 when it is alone or as the start of a time > range, and be treated as at time 24:00 when it is the end of a time range. > > Then there could be hooks that offer to run the function automatically when it > detects the user's system or emacs is set to a different timezone as in the file > (e.g. when they open the file, or opens the agenda). This will make sure the > timestamps always aligns with their current one (if they wish). > I'm sorry, but I don't like this idea. In general, I think it is the wrong approach and not sophisticated enough to work with the complexities associated with timestamps. This is actually a very hard problem and not one which can be adequately addressed with something this simple. Problems include 1. Timzone alone is not sufficient. Offsets from UTC change due to daylight savings times etc. 2. You can easily have timestamps from different timezones in the same org file 3. Storing timestamps in local time is problematic because of the inherent ambiguity this can have (again, due to daylight savings times and what occurs at the 'cut over' time). 4. Sometimes, you may want the timestamp to reflect the date/time as it was when recorded and don't want it to 'change' because your now viewing it in a different timezone etc. Personally, I think timestamp 'storage' and timestamp 'display' need to be treated separately. I also think all relevant information (timezone, offset) need to be stored with the timestamp. I also think the fundamental base timestamp should be stored as UTC, allowing all time calculations to be consistent (free of daylight savings time changes). The user can then manage how the value is displayed by setting timezone and offsets as appropriate (with perhaps the default being the local system settings or whatever offset/tz was stored with the timestamp itself). It is very difficult to predict or understand all the use cases for timestamps. Therefore, any scheme must be extremely flexible. Experience has taught me that one critical component is that at the lowest level, many problems are avoided if the value is in UTC. Problem is, UTC is not terribly human friendly. Luckily, this can largely be automated for many common use cases. Unfortunately, it does also mean that if you are someone who frequently moves between many timezones, your situation will be more complicated. ne of the most frustrating parts of working with timestamps is daylight saving times. This causes complications at so many levels. In particular, I hate the fact change over dates often change and more often than not, those changes are based around politics and at the whim of politicians, which makes programatic handling more complex than it needs to be. -- Tim Cross