From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.bugs Subject: bug#72570: 31.0.50; Regression in date-to-time Date: Tue, 13 Aug 2024 17:09:14 +0200 Message-ID: References: <86zfpige7k.fsf@gnu.org> <892ebc72-1020-471a-bdcd-8e8da10d61dd@cs.ucla.edu> <86ikw4hdw2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14548"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72570@debbugs.gnu.org, Paul Eggert To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 13 17:11:10 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sdtB0-0003bg-7h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Aug 2024 17:11:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdtAM-0004UC-Fx; Tue, 13 Aug 2024 11:10:30 -0400 Original-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 1sdtAK-0004S2-MU for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:10:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sdtAK-0003Pq-Cn for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:10:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=+oNsDoKcMiOBQpkFk8rPwLu6E0s5TImWFAsASWD6bKI=; b=pLHXA09P8YNKR7FvVvUkmTf9QBiR4JZEm4ztd2DSDImVnQ9A1foeLkmTmQIOdis8yoCECa7/HNHqlOnTq4sni7+BH9Jy5x+fOb3qtEyIHoCxetrdjD1qzKaaa1wH9T0XA75a8AYlhqYxuAFUJrh3JVjTvrs+hMjjBLwqHtuz1t3MhM0x/XOBjMQOEuHeKvRgwrlEyYW9h1myZ7eMNSIOXgxSVpFsE8GWEjvuxSijYDTqt5amilisCVz9eEKpsLJi18MJkacVfFXWzLj5UsyYEeW4TjJ/0MElSBwPlYIEPu9SQf0jwh4kGLaqGGVRvfLQ4kBBshGupyEqHmSX81Dlxg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sdtAr-0003GL-S2 for bug-gnu-emacs@gnu.org; Tue, 13 Aug 2024 11:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ulrich Mueller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Aug 2024 15:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72570 X-GNU-PR-Package: emacs Original-Received: via spool by 72570-submit@debbugs.gnu.org id=B72570.172356183312374 (code B ref 72570); Tue, 13 Aug 2024 15:11:01 +0000 Original-Received: (at 72570) by debbugs.gnu.org; 13 Aug 2024 15:10:33 +0000 Original-Received: from localhost ([127.0.0.1]:45373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdtAP-0003DW-Ax for submit@debbugs.gnu.org; Tue, 13 Aug 2024 11:10:33 -0400 Original-Received: from woodpecker.gentoo.org ([140.211.166.183]:59522 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sdtAL-0003Bq-NH for 72570@debbugs.gnu.org; Tue, 13 Aug 2024 11:10:31 -0400 In-Reply-To: <86ikw4hdw2.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Aug 2024 14:15:57 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290080 Archived-At: >>>>> On Tue, 13 Aug 2024, Eli Zaretskii wrote: > The change which affected behavior that triggered this discussion was > done because evidently timezone-time-zone-from-absolute was deemed to > be too slow, and therefore the authors of the change wanted to avoid > it. I'm okay with making the result of that change the de-facto > default, but then (a) we should document this change in NEWS including > the (trivial) way of getting back old behavior, But what is the old behaviour? The one that is documented, or the actual behaviour of the code? (format-time-string "%F %T" (date-to-time "2024-08-13 00:00:00")) "2024-08-13 00:00:00" (format-time-string "%F %T" (date-to-time "2024-8-13 00:00:00")) "2024-08-13 02:00:00" In the first case, parse-time-string (inside the first condition-case) succeeds and it uses local time. In the second case with a slightly malformed date, it takes the detour via timezone-make-date-arpa-standard and uses UTC. Also: (format-time-string "%F %T" (date-to-time "2024/08/13 00:00:00")) "2024-01-08 00:00:00" The GIGO principle at its finest. :) However, I'd much prefer if the function would check validity of the input and error out, rather than returning a nonsensical result. But maybe that's another issue and outside the scope of this bug report. > and (b) make sure that > the new behavior happens even if the body of this condition-case in > date-to-time: > (condition-case err > (let ((parsed (parse-time-string date))) > (when (decoded-time-year parsed) > (decoded-time-set-defaults parsed)) > (encode-time parsed)) > does not signal an error.