From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id +MX/KDjjRWZfhwAAqHPOHw:P1 (envelope-from ) for ; Thu, 16 May 2024 12:43:04 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id +MX/KDjjRWZfhwAAqHPOHw (envelope-from ) for ; Thu, 16 May 2024 12:43:04 +0200 X-Envelope-To: larch@yhetil.org 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715856184; a=rsa-sha256; cv=none; b=bXQCWkm8X7czkBjB30NuwkP6nkaUrYcqt+0VyS/fdAYBcdgZ1EGcftMuqvb5ViuOWG+YX5 UpqzV4V8iCxbcN16JY2nlX+HAJb7lcaeE2X25qD85HWwq9CwMK/tZT7c+ZKjgYsCd0kh+s YfU4VGmdB9riE3HRwvMZW+HM0RiQ+NB3UotOOFpIDLfLXiVQO14l/c86D+ypCj/AEAsBT/ cNer2r4K1w9Nywq3jsI2a8+DvzjdXl4qaJO+7Q9muzcw6WNVQ8rT9yatQdPFc18iFYLe2n vivMNWWIX4meqohyMaCo+3dbZ3r/TZlN92IuOXy7R8Ut2DxPzEz0cwwB4z/o9w== 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=1715856184; 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=0XNIYQI7zJmt20fVKsahhkD54sqstqV+EChi76hoZA0=; b=MKOCsa5gfxYYkAJ4sf7SmYAHQccMTZDlXcPwTejcCF/kfyKJjfz6w26eTgfuv25852nGaj HAv+NQ6dgk96zbR1Jjerbg8X8FCxZXcCjRani8EllAltX/RVhM+fr1C20oxG7zg+J86VpX B1TDGSBl/pP96dyjHoX8TdR6q3ccNuK04yzmbkGjK2LyOGKZAjZvydgpIMMAjT/+Qpnj5S 3hwjAuNDjJDscd2lkPVV1P3drkdfv4iO1O1/wfT23VdQtcZB5OKYbiugsws10swtxMLgfi UU1xpS/0HNQf6dIFndlH5uOuryly0VXmzPQyJGcqWHS8TFvt3cfBuFEwGt1xOA== 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 803BC24466 for ; Thu, 16 May 2024 12:43:04 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7YZ1-0001bT-O9; Thu, 16 May 2024 06:42:20 -0400 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 1s7YYs-0001al-0u for emacs-orgmode@gnu.org; Thu, 16 May 2024 06:42:11 -0400 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 1s7YYq-0002YF-5J for emacs-orgmode@gnu.org; Thu, 16 May 2024 06:42:09 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1s7YYo-0002zK-Bh for emacs-orgmode@gnu.org; Thu, 16 May 2024 12:42:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [POLL] Dealing with +1m/y repeaters when jumping to impossible date (should 05-31 +1m be 07-01 or 06-30?) Date: Thu, 16 May 2024 17:41:58 +0700 Message-ID: References: <87frvzodze.fsf@localhost> <87v83if2io.fsf@localhost> <87seykpn58.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <87seykpn58.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.248, 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 X-Migadu-Queue-Id: 803BC24466 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -0.86 X-Spam-Score: -0.86 X-TUID: +tZ4OIb2Ri84 On 14/05/2024 19:56, Ihor Radchenko wrote: > Max Nikulin writes: > >>> +(defun org-time-inc (unit value time) >> Is there a chance that support of intervals like 1h20m will be required >> later? > > Not sure again. I simply used ts-inc function signature from Adam's > ts.el as reference. ts.el has `ts-adjust' that may change several fields. I had in mind specification of time interval from RFC5545 iCalendar P4h20m. >>> + (if (memq unit '(day month year)) >>> + nil ; Avoid auto-adjustments of time when jumping across DST. >> >> Sorry, but you have to use -1, otherwise >> >> (format-time-string >> "%F %T %Z %z" >> (encode-time '(0 30 12 15 1 2000 'ignored nil "Africa/Juba")) >> "Africa/Juba") >> (error "Specified time is not representable") > > Hmm. I am not sure if it is a real problem in practice. You are right. When you are using TZ as integer offset from UTC, `encode-time' does not signal any error. It ignores DST. However it is the case of conversion to local time a timestamp with arbitrary explicit offset, e.g. taken from a Date email header. So my example is wrong for current patch revision, but the code needs a fix. You need to get local timestamp for given local time. You should use -1 for DST and nil for TZ. In some cases it may cause change like 1:30 to 2:30, but it is not worse than date drift from 31 to 30 or even 28. > The reason why I forced DST nil is hysteresis of glibc when dealing with > DST transitions: As I wrote yesterday, you example is unrelated to glibc hysteresis. The reliable way to deal with ambiguous time close to time transition is to have get next transition function for given timezone and a way to resolve ambiguous time (DST can not help in some cases). Heuristics with trying a day before and a day after should work, but it may impact performance. Your patch allows users to choose if they prefer May, 31 to July, 1 or to July, 30 drift. It may be an improvement some of them. I think, they actually expect choice to get June, 30 and July, 31 or to ignore June since it has 30 days only.