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 CDtqKqJcl2PnBQEAbAwnHQ (envelope-from ) for ; Mon, 12 Dec 2022 17:53:54 +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 AORVKqJcl2NH1QAA9RJhRA (envelope-from ) for ; Mon, 12 Dec 2022 17:53:54 +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 5D0613F61D for ; Mon, 12 Dec 2022 17:53:54 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4m3K-0004N3-Q6; Mon, 12 Dec 2022 11:53:18 -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 1p4m3I-0004JH-ID for emacs-orgmode@gnu.org; Mon, 12 Dec 2022 11:53:16 -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 1p4m3G-0000tt-Ue for emacs-orgmode@gnu.org; Mon, 12 Dec 2022 11:53:16 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1p4m3F-0000kk-2W for emacs-orgmode@gnu.org; Mon, 12 Dec 2022 17:53:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Two problems with export to Google calendar Date: Mon, 12 Dec 2022 23:53:04 +0700 Message-ID: References: <877cz3l6cl.fsf@localhost> <85f7d530-5d76-4bf5-7225-40d7e3011d0e@gmail.com> <87sfhkg1sd.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: <87sfhkg1sd.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: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 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.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670864034; 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=NA1/doUHg4SvOiqdgVJJTmAnUSgRT4ubYw9ZNsc7SA4=; b=NEaFrXXqmuzE123QO4gE57u+uzAl4rJrXeAZ4ju9W7h2/j6HEZUKVtE3qr0vrDm15OqC49 yTYxur38LoWLxXNzgG2ZQ3TVKWXdla7oZFwjsV9aTOwYyvxUkMu7q6SC6xKdaVBgvIGAve Y/jU/QSkblt37A+w71CPEsAkD800CQ3/SzGzCywALTJ6P2SAVKwH+uZ60LEymZO62dy706 jru//QFolAJeSg0hxqSP64988Bns4xt5lBDKViEIBa9raaPKfOfV+vY1cEAy+8uzekT9xu fX8TdeQAg11OAaNwTy34JKq05nP+fU9hHwe8/FguUDbv6iO6vJkHHE77f0bDBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670864034; a=rsa-sha256; cv=none; b=k4BDcp4WKyDSYREGppqisC3GbUfz3AkjxLtqUOS8ZPPWmO3W7vPl7pTAEIUvByqomgZWDU u4ebr0nb9QdplyGz2tyo+WOmy231YBNqq9wH4IlERSIv19kYkOIl60ai1FnwyDsCwDA1Is Vf/n6BGNA+UmSRT11G2HnmgMbdK2rFD7ye4ycJhrEVn1tLhltB7e3NVNmRBQdBrG5ptdNo XqUnmUil2dam1ZEEAnsHqxkdoIv9PZUXewgnE09sMeuoK1l9ObxP067gVP0s5t7y3DhfB3 USg3AIDp53Kxz6Iz+iY/6cLAemqdya5Ga/KLH5XBRNieeWNRFq1QW4w4NPAMBg== X-Migadu-Spam-Score: 2.44 X-Spam-Score: 2.44 X-Migadu-Queue-Id: 5D0613F61D X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) X-TUID: NtdoukoawRBg On 12/12/2022 21:00, Ihor Radchenko wrote: > Max Nikulin writes: > >>> By default, ox-icalendar takes the value of your TZ environment variable. >> >> I think, in most cases TZ is not set, so (format-time-string "%Z") is >> used to get abbreviation (that is ambiguous). >> >> On Linux we may try >> >> timedatectl show --property=Timezone --value > > According to POSIX standard > (https://pubs.opengroup.org/onlinepubs/9699919799/), we need to use "TZ" > environment variable, when present. Otherwise, fallback to defaults. I do not try to dispute such statement. The question is what should be taken as the default. > This is exactly what ox-icalendar does. If TZ is set, use it. Otherwise, > use `current-time-zone'. ... > The issue in this bug report is that TZ is actually set. Ambiguously. In > OS. We cannot do much about it. Outsmarting system settings is not a > good idea. The TZ environment variable is not set and that is the issue. Otherwise the .ics file would have X-WR-TIMEZONE:Europe/London The problem is that there is no API to get time zone identifier in elisp because such function is missed in libc. It is possible to get only BST/GMT (depending on current season). Identifiers like Europe/London allows to get history of time transitions. (format-time-string "%z %Z") and (current-time-zone) may only report time offset and ambiguous abbreviation at particular moment. Return values of these functions may vary for different timestamps in the calendar file. If list of time zones were available then it would be possible to iterate over it and to match particular time zone by abbreviation and offset for most of zones (perhaps some ambiguity would remain). Actually `current-time-zone' is an example of fragile API for *current* time. Offset is valid for particular moment. There is no guarantee that offset would not change between obtaining it and applying to a timestamp. So the only safe way of using this function is with the SPECIFIED-TIME argument. In such case *current* in the function name is confusing. So in my previous message I was considering feasibility of some platform-dependent code to determine time zone when neither TIMEZONE Org file property nor TZ environment are specified.