From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QIzRKq+uy2NJuQAAbAwnHQ (envelope-from ) for ; Sat, 21 Jan 2023 10:21:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2LgDKq+uy2O+VQEAG6o9tA (envelope-from ) for ; Sat, 21 Jan 2023 10:21:51 +0100 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 86C92C947 for ; Sat, 21 Jan 2023 10:21:50 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJA3b-00016c-1N; Sat, 21 Jan 2023 04:21:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJA3S-00016A-R5 for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 04:20:56 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJA3Q-0000iq-G2 for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 04:20:54 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id A5B402402E9 for ; Sat, 21 Jan 2023 10:20:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674292849; bh=j2+74t/C9equ35lp9WO7c90xDu1uzCUW+JBwmed92NI=; h=From:To:Cc:Subject:Date:From; b=YTqbvO8Sa2umPC+4k/7ryPWJY3xOndaLM9FdrvXQj3a/L04HUNLvY7KSRxrHMImBA 4JTyareoa6iB9X7Xoi5uSShe8mBtIRMEQ8IAwwUEmIBOUY7RmHC9E+5h/XtB9Ru6B0 BWf8xzQDbk1D2/SDfodis8l9InIoITgS95W+C5wZkg5oyJLC3CEX9uMbkYZIgoDShF /NK6lvyAWmC+fe3X6h3oTsdMnkK+4ZMpFgKcYblWpEgdxqeYBXfVc4st/1OPohN0kU pmX0TPb2MurB1NrY9jtighfZJ7/yDEdOt+dFVANdZZXvfo/zOyz0AMVRcb5ncN4rtA yZjlgfq/WE1zQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NzW7M5Jzkz9rxP; Sat, 21 Jan 2023 10:20:47 +0100 (CET) From: Ihor Radchenko To: "Fraga, Eric" Cc: Daryl Manning , "emacs-orgmode@gnu.org" Subject: Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda In-Reply-To: <87fsc5h1ul.fsf@ucl.ac.uk> References: <86zgamtv6o.fsf@gmail.com> <87tu0t1i0c.fsf@localhost> <87k01p1gvx.fsf@localhost> <87r0vpscba.fsf@localhost> <87fsc5h1ul.fsf@ucl.ac.uk> Date: Sat, 21 Jan 2023 09:21:19 +0000 Message-ID: <877cxgqm40.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, 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.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674292910; 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=vzeoHrTaw0AA+D/z98ZVYNmClfEiI7GGwGYmawauw5c=; b=ZEPR4oT08aKrPT4HNenjPYB+99s5z/24DKmfxsoPz7k4aRzI3rJp8ddYx0gl3C9KII23tz iJI5DmR1PQDzR0aLhYav+gtWA2PivriM12gUpgPhu82KRAai+kUAcGARzrUJU95ppNuzDi 70dtIax4k9gXmnnlhp8ccRglzpI6itbuV1fcvJYjm6/H+BJf2wZv08ntwrvqWShtdZqQwz Uj60n2SZ/mF3J8X0wzSKcMvHjLwQt2L9KtkyXMjPi+RvHpLjP5ad2UFqVeHVIzMyXGRMFm ePN4Q8mianDG5bEMGonfZ8eGwnRyImMVUB+Xk/qOi2zj4yx0zCSMuyGbrtlBWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YTqbvO8S; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674292910; a=rsa-sha256; cv=none; b=bssnz1i8SvzdHHZQf6e4O/cS2OGNbNyBx4BdI0lGhbouLZRPfsWCKlJsM/pA4btH6sVEjZ MX9lua9kp6ZJaMJT7mIyYMzSqH9iZo5FtE9jVw9Ur4X93w3Hq0UbV5/6+mjUgvO8y+Enk6 qVfqEb4CpVaMqpmY7x5mknnOcFgq9brcGmNVLMHtIvilctuE2XtR4tZxfM284XI7YnFqKI sgmKXXrELS2iYK/omTXihew5U6hxQGgVAVktaPwwai2mGGGoYylXt75YAhD17jf1ou8rMg fWZWNNlFrjCvyMIedgen02Tajr0OBksGTjERHY+5TpSr3mAVqcyUxfHRP8ByoA== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.56 X-Spam-Score: -4.56 X-Migadu-Queue-Id: 86C92C947 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YTqbvO8S; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: A6OzbCUGbBSq "Fraga, Eric" writes: > However, having said this, I don't think it's org's responsibility to > address the Emacs Diary: that would be a feature request for Emacs more > generally... I looked into this further and I note that `calendar-absolute-from-gregorian' does not account for time zones at all: ((> year 0) (setq offset-years (1- year)) (+ (calendar-day-number date) ; days this year (* 365 offset-years) ; + days in prior years (/ offset-years 4) ; + Julian leap years (- (/ offset-years 100)) ; - century years (/ offset-years 400))) ; + Gregorian leap years Diary sexps are using this function frequently. In fact, Org also does use this function frequently. Probably, the only sane way to address all the pitfalls with time zones while using calendar functions is first converting the date to UTC before passing it to diary sexps and calendar functions. I hope that UTC is at least not affected by all the crazy time transitions various time zones have. Though I am not sure about the calendar displayed alongside the `org-read-date'. It ought to be in local time zone, but the above means that not everything is accounted for by Emacs calendar. Also, agenda. Things like `org-extend-today-until' may be dramatically affected if we try to convert things to UTC. Or should we just bite the bullet and use "local" time zone for agenda calculations and calendars? It will not be accurate, but I am afraid that rewriting agenda to support UTC is going to transform into rewriting agenda completely + rewriting Emacs diary. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at