From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GEyRMs4TRGK3fQEAgWs5BA (envelope-from ) for ; Wed, 30 Mar 2022 10:24:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id kAguL84TRGKITwEAauVa8A (envelope-from ) for ; Wed, 30 Mar 2022 10:24:46 +0200 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 26FC4BFCD for ; Wed, 30 Mar 2022 10:24:46 +0200 (CEST) Received: from localhost ([::1]:60386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZTdE-0008N5-Go for larch@yhetil.org; Wed, 30 Mar 2022 04:24:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZTW1-0002pb-Pz for emacs-orgmode@gnu.org; Wed, 30 Mar 2022 04:17:23 -0400 Received: from mail-db8eur05olkn2017.outbound.protection.outlook.com ([40.92.89.17]:33313 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZTVz-0007gg-If for emacs-orgmode@gnu.org; Wed, 30 Mar 2022 04:17:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJoefKfffayMao8ncXxtmV77huZNdMpBZqzlPVefsuH8scJ7OwaYW/ljS1A41xqW6iNYfQhwky/fFcZc/6k8XQZMLCsyycr/ORgeSEDftZGDEuy8AmxdxWed3pIau9i3znK1YSj9WihAydMJLhrjNZ6U1fZeEpoEMm49QNQ7Vde2Y2bvytoWCuVUd7VwNBZUnqWXs2os4zqorRv910TeCHjZgxx09nix1QjFbC3xYkRNglJ1H6iEPxB+gh54sME5t6B8ETWXo5oZNsIWGW7kZUPQEILpS9oLyrW4+GdUlU8e2mGsQtkQ4FzowxcQZp/mo1n8uW6AmEyIZdQ2WKu3vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=iB8KtPZk9VnW8xUcwfCTeKCqp2q27KtKzLzHp5FTGfA=; b=UjfrDGUDtZu3/BMrnijHV8bomocW9N4m5yIR+4Vt7kmTlSGdLNcJMbadPpYuexbQmIXUL/tgz47GjPoyWNG56wgktYnyk/ieDTJRG7ME3NO8a5PHO4sOA1lzUFTUOTTYJfkHV25WtXT3Ku38ITZIbLJ4YeEso4cGzUq7xi687DNVIETs770Dk8ztbD642TRNUuQaMaQw9KsxGOv3iKKYAarmh1ZgQVPmieP1zJXc1X+HBcXXZeg6Z1PA7ySAM4T6ZejK0a4eg51cvohqar27T1VQ5+P7QPKF63yXfReSb9639ITGh0+FvCtsXWs/036XOHEHgPh1z/6/nShSFe6csA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iB8KtPZk9VnW8xUcwfCTeKCqp2q27KtKzLzHp5FTGfA=; b=PQE4/LXTLBdWnFBoM795kD3SxlQUWIuVc5j+iW1CkEDdz6HnmghjWuT9DOuYzr+/DifUJAuUEja55jEeF6LRQIa/L+94BJDHMEXBRvwPzbPUCCjtT6luGckAnAEjz3DGTisElZj6NvUgehUG581KY/m2ol/g9tx/RWreElFnhBEO4kaVJ/YJhO9/x4iAEyEl8ZPnn2fs9dOp9jU2HIJFjgMf80ys4udKRS8Fpw7qa4KgPjOOXKuQmFi2WyykwmeUxdR3ow97eNXiYqUSWULjD+2jy2GXqgQNL06vQvR6IGkaXiaWO80oGaVFB+dGi5+p7iM5OPJPSf/7TLprWsPUJg== Received: from DB9PR06MB7753.eurprd06.prod.outlook.com (2603:10a6:10:258::12) by VI1PR0602MB3392.eurprd06.prod.outlook.com (2603:10a6:803:6::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.17; Wed, 30 Mar 2022 08:17:10 +0000 Received: from DB9PR06MB7753.eurprd06.prod.outlook.com ([fe80::901a:3011:5a27:47e1]) by DB9PR06MB7753.eurprd06.prod.outlook.com ([fe80::901a:3011:5a27:47e1%9]) with mapi id 15.20.5102.023; Wed, 30 Mar 2022 08:17:10 +0000 References: User-agent: mu4e 1.6.10; emacs 29.0.50 From: Ignacio Casso To: emacs-orgmode@gnu.org Subject: Re: [BUG] org-agenda thinks timestamps after 23:00 correspond to the next day [9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio/repos/emacs/lisp/org/)] Date: Wed, 30 Mar 2022 09:13:29 +0200 In-reply-to: Message-ID: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-TMN: [yON5W/toB0w3Rrf7G58+YQmPXYbQ9mnZ] X-ClientProxiedBy: MR2P264CA0077.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:32::17) To DB9PR06MB7753.eurprd06.prod.outlook.com (2603:10a6:10:258::12) X-Microsoft-Original-Message-ID: <87lewretxb.fsf@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e9251af-97ca-4df7-0b7a-08da1225afb8 X-MS-TrafficTypeDiagnostic: VI1PR0602MB3392:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Ki9mTjf0uU1QVrjV5+HBxb2lSzykBWriD/xA17Qn8KhwrPtHvHlc6lhyibFK3DFiY5H6e0+zw97T5Nj1IoAqq7ofm3Yu8Ny0ExHDCEVxRxbwkl4a5i7gRcoEgV0EdemfqPzp/tpuH4sEAu7cRfgkMq1EFvFoOLir2d8pznpRVFd9MXUGGNIQBA4HeizOjAsVDNSsKltosyDHFgr7J3u/5lNqUXiKzG5uzTNuPO1SVwkDo+D5NytSqcL0a07hZm66E6XNwSzdKZIJWsqnrVjGyeFXTzrZ1vtXjmKV+ZNe/gJLFtC6hgQG4aTRiABTC1VvV5z/WYWTRGunWIKhzuygP9YQ6SWuW8m6OAFt1s8YN1+D3NP0KKnWykh5BfhRcRnXccwrsUaU987lbNOFAunZS0M9w2LafotBkoEN0rsRXpIa4fYtYSiuGdYMTwyXo/f6fqw2MM7uTmGQmQg/kneayB4Zn18l7dZmO8SFhynE9KUaSnxIivSL4cG73l6BGjmeVmN6ze1fER/l1so2u4iTbxVx3bIK8uFRxolOjM1shWF6GMgzCsSQIWc9hBpqi28POsp6MFfAtMH5xS/8iVibA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NmNGZXRJYitmSDJpQ2x6SWFhb2lZOUpWLzd0TTNVR3VWamVXR1JBK0VzWkM3?= =?utf-8?B?YnlGRTRaVWxtQVp1VEJLTTBLZTl6UWh2cGphSU9lU0k2VnQwS2Z0bzMwM1NE?= =?utf-8?B?aXljaURxcElxNk92ZFFqN0JtaVErQ3ArdTh6QTNmUjYzVy9KLzBHTnlTNGhR?= =?utf-8?B?N1VzZUhHeHRjY3c0bj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9QcjEwVXh0QzEvcUZFSjVmdFFMSDNGMTV2QmgzTVBH?= =?utf-8?B?cmg2RkRBU0s4dUhXS1pKZGZzQU1DS3ZxR04yamhXcHFJc2lIY0RxR2F6SEQ4?= =?utf-8?B?WExRSXloVk94ajVlVGNrYk04M29FczNmU1R4RVl6em9PNjk0SG8rQ3E1ZWpH?= =?utf-8?B?c3U2V1oyTmYza21DYmRDcVBpL2tBbEVuMzFvK2EzNDdUWk9XdjNOTXlhaEdB?= =?utf-8?B?REU5RWUwRy9MTy9WTC9pR20xYTcyOFJvZFQ0bGsycytPQ3Y3cVRaNi80aVRF?= =?utf-8?B?dm0zOURaYmlxcnhOVlY1WEdFZ0hZYlJvNkVWdkV3a1ZXeW90eUhqYTMzbjJV?= =?utf-8?B?YmdnajNyUVJ0ckpBVGdJbFFxRHVHREdhMUZTVE9wa0NhR09ESytzMnJFVWov?= =?utf-8?B?WFJEV3UySG90VEFpbzlhY0haYUhVUVJ1N3U3SzJpKzlqeXhqNGZKZ2VLbXh1?= =?utf-8?B?bjByVE1BVnFHeEhnNENxNEcwbEZ3VzFJdlNpcDVCS2FyRWZkbzh5U0xTdmFu?= =?utf-8?B?RmxpbDlMY0lkMkV6L3YvRFVIRHRmekdvWkVqTWFDczFXZmRseElHbU16ZWdp?= =?utf-8?B?VEQxTzd2cGgwMEFiNTczVmdaOUNjbXhEWTI4b1I0SmFDeTBLUmVWeW5QcTIv?= =?utf-8?B?ZUdzcGFGYjhqSUdmSjRWamVQRTdSTEtDdlNTTDRhMS9lL1AvV0tEUVBTRjFO?= =?utf-8?B?MEd4azJqSkZGYTN3T2dFTmppSWpHaCs1TVV6TnBmM05mYlZCWUsxWXVydExx?= =?utf-8?B?WFpXTXYyNUpGdzVPNnQySDF3TGpJSjB1bzNINWNSdzZzTnU3WTljdU5NYTNC?= =?utf-8?Q?HK0JjolUnD8=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 1e9251af-97ca-4df7-0b7a-08da1225afb8 X-MS-Exchange-CrossTenant-AuthSource: DB9PR06MB7753.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2022 08:17:10.6740 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0602MB3392 Received-SPF: pass client-ip=40.92.89.17; envelope-from=ignaciocasso@hotmail.com; helo=EUR05-DB8-obe.outbound.protection.outlook.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648628686; 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:dkim-signature; bh=iB8KtPZk9VnW8xUcwfCTeKCqp2q27KtKzLzHp5FTGfA=; b=V6+PRp01/pYeIDn467pgGZcT4cBVYV8bUGUkEUtpMGGe60POEfcFzuDuld+9FoLEberLDX cLYtuPb+8ix0SCVm3ozijFt8bSdWMiGOvjfHOGONWoXbDReDZK3QpYVoGAzOQKbnUUwYxu DuJdQCIcMdCyPY4WEJNGfmhFpVPMZXVrhTSGGDcEmmMLbvMfzt93eo3ZdfbLRIMjjyIUcV HsoeXi4iuR2P0ShtGZ0TtKaKZJ7gUyPfou5Wxpk9puBTUpPJED3DVy5xLb88QI+lyU6ikX 0PRHUma8V73RjyHE6m+y4XRkHYywG/X+JoAYNrXYZzNuOdHI2CZvI/VaxJCtkQ== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1648628686; a=rsa-sha256; cv=pass; b=uaEysWyfY/ShQKvqqKGGBFpRkQ3cl5pdpP/Xghr+zgO//jdAAaEBzPmArIf+thvtPEgtK8 GYkr9lJqCjFXZt/tc3goVEFF1htkJASDxa0CJUKmswwREb28xA3E+VodNs1YTgMm3GVlgH LwY/WjDDtSyCXYe9Adk/N2EqVv6cwSD36rtPV8cYIe4xLmgiPH1nHjSd1LbjzSSeAnkKPh yj07bzk/E37uBo6ACxcY8yCsFFOf2OKlUP4rurhogAnM+Wyne0YKAKl+S5/4A17phtLxCo 8HmjmFmkSBdUEWJGL4V2/T5ZkQQro3HBGgAm3qH4ClRWrlq1SD9B2gFA89tDAw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="PQE4/LXT"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.com; 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-Spam-Score: -5.07 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=hotmail.com header.s=selector1 header.b="PQE4/LXT"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=hotmail.com; 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-Queue-Id: 26FC4BFCD X-Spam-Score: -5.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: RyIhzpgrBr04 Actually, this only happens with SCHEDULED timestamps, so it might be considered org-mode's fault since the handling of normal and SCHEDULED timestamps is not always consistent. The reason it is different is that `org-agenda-get-timestamps' looks for timestamps in the org buffer using a regular expression that already matches only the expected date. `org-agenda-get-scheduled' can't do that, so it uses a regular expression that matches any timestamp, converts the timestamp to an absolute date using `org-agenda--timestamp-to-absolute', and compares with the current agenda date. `org-agenda-get-timestamps' also has to do something similar for repeated tasks. However, the function used to get the absolute date is different for those timestamps. The function for scheduled timestamps boils down to (time-to-days (encode-time (org-parse-time-string timestamp))) but for repeating timestamps, it boils down to (calendar-absolute-from-gregorian (org-date-to-gregorian timestamp)) For the timestamp "<2022-03-30 mi=C3=A9 23:00>", the second form returns 738244 in my machine, which corresponds to (org-today) at 30/03/2022, but the second returns 738245. Thus, repeated timestamps still work, but scheduled timestamps don't. Is there a reason why two different ways to obtain those dates are used? For completion, I have also checked deadline timestamps, and they suffer from the same problem as scheduled timestamps. A deadline for today at 23:00 will appear in the agenda as it would a deadline for tomorrow at 22:59, that is, with a warning that it is due in one day, and not as a deadline for today at 22:59 would appear. Regards, Ignacio Ignacio Casso writes: > Hello, > > After last Saturday's hour change in Spain, org-agenda thinks that > timestamps after 23:00 correspond to the next day in Emacs 29. I'm not > actually sure if that is the reason, since I usually use Emacs 27, but I > guess it must be that if I have found out three days after the hour > change. > > I have tried to track down the problem, and it doesn't seem to be the > fault of any org-mode code change. The problem is that > (org-time-string-to-time timestamp), defined as (encode-time > (org-parse-time-string timestamp)), returns different things in Emacs 27 > and Emacs 29. > > Let's consider the timestamp "<2022-03-29 mar 23:00>" as an example: > > 1) (org-parse-time-string "<2022-03-29 mar 23:00>") returns (0 0 23 29 3 > 2022 nil nil nil). > > 2) (encode-time '(0 0 23 29 3 2022 nil nil nil)) returns '(25155 29520) > in Emacs 27, but (25155 33120) in Emacs 29 > > 3.1) (time-to-days '(25155 29520)) returns 738243 > > 3.2) (time-to-days '(25155 33120)) returns 738244 > > 4) (org-today) returns 738243 > > Therefore, org-agenda thinks that "<2022-03-29 mar 23:00>" is today in > Emacs 27, but tomorrow in Emacs 29. > > `encode-time' is defined in C, and is probably system dependent, so this > is probably not an org-mode bug. But maybe org-mode code could try to be > smart about this? I don't know if it's even possible. > > And if this should not be fixed in org-mode, do you know were it should? > It could be an Emacs bug? Or maybe the problem is in my system? > > Regards, > > --Ignacio > > > Emacs : GNU Emacs 29.0.50 (build 19, x86_64-pc-linux-gnu, GTK+ Version 3= .24.20, cairo version 1.16.0) > of 2022-03-29 > Package: Org mode version 9.5.2 (release_9.5.2-25-gaf6f12 @ /home/ignacio= /repos/emacs/lisp/org/)