From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8BsHOGi7y2PL9gAAbAwnHQ (envelope-from ) for ; Sat, 21 Jan 2023 11:16:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 0IsROGi7y2NXsQAA9RJhRA (envelope-from ) for ; Sat, 21 Jan 2023 11:16:08 +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 BB8A129257 for ; Sat, 21 Jan 2023 11:16:08 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJAu1-0007rN-3Y; Sat, 21 Jan 2023 05:15:13 -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 1pJAtz-0007rF-Tu for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 05:15:11 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJAty-0005ZC-BU for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 05:15:11 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pJAtv-0001cv-K8 for emacs-orgmode@gnu.org; Sat, 21 Jan 2023 11:15:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda Date: Sat, 21 Jan 2023 17:14:59 +0700 Message-ID: References: <86zgamtv6o.fsf@gmail.com> <87tu0t1i0c.fsf@localhost> <87k01p1gvx.fsf@localhost> <87r0vpscba.fsf@localhost> <87fsc5h1ul.fsf@ucl.ac.uk> <877cxgqm40.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: en-US In-Reply-To: <877cxgqm40.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 27 X-Spam_score: 2.7 X-Spam_bar: ++ X-Spam_report: (2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.089, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674296168; a=rsa-sha256; cv=none; b=M7z4sRJx+kYaW8Dk1li/jXZ9yr1SJc2qrlxiXpBs+fr7COY6zcYEpz6FiKPQcyJPnGcbHk 5/my8HEPcD7KKklSCSBddeUASeM9tfMYE97wTbnRU7C5jSfY/sItHCiVu7ErdfqVsRlquM E9BbzQca8UchoZ4RhPdtjRzdLpoWfyT8pyEEeVOdEkmmt99g/CmICC7LH/3WFJ2Ol/VFTA iM9PIM49kURHaZifa7xSAl8A99Jcb6js9UONWg8k9J0D1y2gacwwQUGNb8u07ohEZDqd9Q nKIk76Fk4VSHMIOwN6hwoW9cT4dn7QZZ9YJ79y5bCBSXS3Luu3hCvzsh8S8J0Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674296168; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7kLVhY9ymHpgcTJHXJA8kRUXcxHymvbjM3v2fm4EfB4=; b=XuMahTjJOsNPAWGJevw33J90xoD8GUXFPZHT3YbY11HCvu29BYYPmWMEv9tcc/tm+ooLNS lcfv/4Aj4P9uIBXCYI87TCZUskqDYuGDvin55rO8E1yf5QjowlUf7tBCqk2G/82vbthewN PSRyT+mUfwE+eJ3hkUIuLuRH45iOwWiu0wpxAM7meY5iHEiCiU8pzsYVGj8Ces1oYX8QB0 IAQ3CL7ubx6If/qAObGjSEyTD/HbffVsPSVz4TugMGgBccxvEAvsQrCKO/nOFRuD2apihs r3fV2zlPFItztk/45rRp2ogIBrBlSRwbnLK73P1O1Oh7PWDCimR98d84ZqNU9A== X-Spam-Score: 3.59 X-Migadu-Queue-Id: BB8A129257 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 3.59 X-TUID: TcNjx1bhOIgb On 21/01/2023 16:21, Ihor Radchenko wrote: > > 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. I have not look into this package yet, so I can not comment it. Should we summon Paul Eggert? https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54764#10 Re: bug#54764: encode-time: make DST and TIMEZONE fields of the list argument optional ones Sat, 9 Apr 2022 00:52:57 -0700 > Generally speaking, > when Org mode is doing calendrical calculations it should use > calendrical functions rather than encode-time+decode-time, which are > best used for time calculations not calendar calculations. On 21/01/2023 16:21, Ihor Radchenko wrote: > 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. It may be tricky to get start of day / end of day or advance timestamp by given number of days having timestamp as seconds since epoch. If you mean broken-down time representation in UTC then I am unsure which way you are going to handle skipped 2011-12-30 case, since dates in UTC are rather regular. > but I am afraid > that rewriting agenda to support UTC is going to transform into > rewriting agenda completely + rewriting Emacs diary. I still suspect that to implement timezone support in Org it will be necessary to create a custom library to handle zoneinfo files.