From unknown Sun Jun 22 03:57:10 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#78096 <78096@debbugs.gnu.org> To: bug#78096 <78096@debbugs.gnu.org> Subject: Status: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent Reply-To: bug#78096 <78096@debbugs.gnu.org> Date: Sun, 22 Jun 2025 10:57:10 +0000 retitle 78096 31.0.50; calendar-iso-to-absolute and %W time string format a= re inconsistent reassign 78096 emacs submitter 78096 Ihor Radchenko severity 78096 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 27 11:29:58 2025 Received: (at submit) by debbugs.gnu.org; 27 Apr 2025 15:29:58 +0000 Received: from localhost ([127.0.0.1]:43641 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u93x8-0008Ib-E3 for submit@debbugs.gnu.org; Sun, 27 Apr 2025 11:29:58 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47994) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u93x3-0008IG-FY for submit@debbugs.gnu.org; Sun, 27 Apr 2025 11:29:56 -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 1u93wu-0000NW-3r for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2025 11:29:44 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u93wq-0005UN-QO for bug-gnu-emacs@gnu.org; Sun, 27 Apr 2025 11:29:43 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id CFDE4240101 for ; Sun, 27 Apr 2025 17:29:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1745767778; bh=7qgHVAFySl0RgQKE82y6WgJ9nLxDhU6kOTe/fSXrHsc=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=f5hnB6NKvxnLEvWzo9UPQ5lJNkZQRnB8sj17811VBYqAJCIsx6u6ieBvY3YN3OZr2 8qph8Gq2UsDdRZKnp2SmAGaHVr1H5lcRRA8TcIZa8YieW2URs1bZ2R1aa+PUfapgL6 c+lpTdlvfnhpH/Tb/jnzIOQyrUn6FtSMb3TWozZ+fpGSezv4VrNqd4gR8+E8eVttSn J1ThftUo+Hzq898MrPaAwBg/vhbt5OWtXz4tNDQjS0F12JBcyW0axMCJ0VT1oyJ/U2 VuamiMjfEt9+UF6ICuPrseo6grqaDAcx+Mu1zXBHEim8Mu3YDvVTDgS3sHItv54g1W aUvLJb+EwhTng== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Zlr9G387Nz6tw8 for ; Sun, 27 Apr 2025 17:29:37 +0200 (CEST) From: Ihor Radchenko To: bug-gnu-emacs@gnu.org Subject: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent X-Debbugs-Cc: Date: Sun, 27 Apr 2025 15:28:43 +0000 Message-ID: <87ldrlpqs4.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, This bug was originally reported in https://orgmode.org/list/174544167676.8.6104466990232889732.690779499@publik.slmail.me Consider the following: (calendar-gregorian-from-absolute ;; First day of the second week of 2025 (calendar-iso-to-absolute (list 2 1 2025))) ; => 2025-01-06 Now, let's try to format the same date using `format-time-string' (format-time-string "%Y-%m-%d W%W" (encode-time (parse-time-string "2025-01-06 00:00"))) ;; => 2025-01-06 W01 As you can see, week numbering is off by 1 between %W and `calendar-iso-to-absolute', which is unexpected. I believe that it is a bug. In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.2) of 2025-04-22 built on localhost Repository revision: a9ace435a341918eae3e01f2941f5bbca04d7795 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101014 System Description: Gentoo Linux -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 27 17:05:20 2025 Received: (at 78096) by debbugs.gnu.org; 27 Apr 2025 21:05:21 +0000 Received: from localhost ([127.0.0.1]:45266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u99Bg-0004bH-Hr for submit@debbugs.gnu.org; Sun, 27 Apr 2025 17:05:20 -0400 Received: from mout.gmx.net ([212.227.17.20]:59613) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u99Bb-0004V8-W0 for 78096@debbugs.gnu.org; Sun, 27 Apr 2025 17:05:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1745787907; x=1746392707; i=stephen.berman@gmx.net; bh=Lk3gdA8Ps3HnCe1SczJvum5eeNGih8W5Gp7PzyCuMlo=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=SYFnT0WYd32r+hDO9Pk9Wp+2JcnX3geZlQOa6mtEzbUxdhItA/r8m2Nyz1ApsSc6 Wew/QssY0F9Wn56yVdS3R/I5Vd5vh7bWhigct3Z0T5ya6eyAb0sbtr/vU4A2/pYsx LkxjjLRVJwUqU9nLxscgJ0wJtF/dutaUqSewqg3vulgddz5YeDGNimERVKcQpc4wU iOuJeApLY32dLwtVEFIcAP8OIojNkVze+F3M5HbvEI2CSeYMcVDkjbVOKAR7JRa8g oDwX5bdRuiUcpZmYgPDfW/MFnWa8JeWz+1OCPZ704fLuO13MrwEkuBgQZseYaftXe BL0PBR50uw9Av/8iZQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfs2 ([94.134.94.115]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbAgq-1ug01z1l7Y-00hLAG; Sun, 27 Apr 2025 23:05:07 +0200 From: Stephen Berman To: Ihor Radchenko Subject: Re: bug#78096: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent In-Reply-To: <87ldrlpqs4.fsf@localhost> References: <87ldrlpqs4.fsf@localhost> Date: Sun, 27 Apr 2025 23:05:06 +0200 Message-ID: <87o6whwc1p.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Q4B8Yjdw864IdnEVgR7Pahod0ue351TSPBMzFPxD9DqUQdxeBbb LT1SReOwyamLz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Db6mwvjScLQGl/IqQkY8/ qPtN+eshdaKC1SwmZ5BX4Lx9J9rqVt/ZAwVPfFMOYJwW5oP9ABGjNPJiTcrIe0Rwb5WJTF5sJ rbamGv81Oca1/afHGNWUag= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78096 Cc: 78096@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sun, 27 Apr 2025 15:28:43 +0000 Ihor Radchenko wrote: > Hi, > > This bug was originally reported in > https://orgmode.org/list/174544167676.8.6104466990232889732.690779499@publik.slmail.me > > Consider the following: > > (calendar-gregorian-from-absolute > ;; First day of the second week of 2025 > (calendar-iso-to-absolute (list 2 1 2025))) ; => 2025-01-06 > > Now, let's try to format the same date using `format-time-string' > > (format-time-string > "%Y-%m-%d W%W" > (encode-time (parse-time-string "2025-01-06 00:00"))) > ;; => 2025-01-06 W01 > > As you can see, week numbering is off by 1 between %W and > `calendar-iso-to-absolute', which is unexpected. > > I believe that it is a bug. The doc string of `format-time-string' says: %U is the week number starting on Sunday, %W starting on Monday, %V the week number according to ISO 8601. (format-time-string "%Y-%m-%d W%V" (encode-time (parse-time-string "2025-01-06 00:00"))) => "2025-01-06 W02" Maybe just starting the week on Monday does not guarantee that the result is an ISO commercial date? Steve Berman From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 28 12:06:54 2025 Received: (at 78096) by debbugs.gnu.org; 28 Apr 2025 16:06:54 +0000 Received: from localhost ([127.0.0.1]:60592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9R0P-00005S-NS for submit@debbugs.gnu.org; Mon, 28 Apr 2025 12:06:54 -0400 Received: from mout01.posteo.de ([185.67.36.65]:33735) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9R0J-0008VT-7E for 78096@debbugs.gnu.org; Mon, 28 Apr 2025 12:06:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9BCA8240027 for <78096@debbugs.gnu.org>; Mon, 28 Apr 2025 18:06:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1745856400; bh=CtF77s7ZZktoJ811wtOrq5S6gYjHnZdC3waszqLOvc4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=gEPL13cojicXeW9O23Fz6wg512Ao3TXy8OZivWQziaYx6S+urceKrtlo24qOgzBQY R8Cjck96nomTaAwKzPf/a3Zg/3oKM2ThvK8nuRpFfnwku56DRimuGZfuTjI92ajQLD om+3GJ7jscLkV7jL5519Dnl3SovDGmKbBUJfweLZBwItkxerD+3N2cu28qGrGbNO+d v5TyBcwIELBIBS/i8GRbGvTODNJFm+Dv8RweU93FERn9bo9BPus8LCorsY0w2BzGH6 P+UpFtb0Bswix/VwEBNDj+bvphvOkLmc5c4viW60qiP+iG1FyTz6auxMlQgX5bNlpT pLSe73Oskk9TA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4ZmSxV5GMyz9rxK; Mon, 28 Apr 2025 18:06:38 +0200 (CEST) From: Ihor Radchenko To: Stephen Berman Subject: Re: bug#78096: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent In-Reply-To: <87o6whwc1p.fsf@gmx.net> References: <87ldrlpqs4.fsf@localhost> <87o6whwc1p.fsf@gmx.net> Date: Mon, 28 Apr 2025 16:05:43 +0000 Message-ID: <87tt68fezs.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78096 Cc: 78096@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stephen Berman writes: > The doc string of `format-time-string' says: > > %U is the week number starting on Sunday, %W starting on Monday, > %V the week number according to ISO 8601. > > (format-time-string > "%Y-%m-%d W%V" > (encode-time (parse-time-string "2025-01-06 00:00"))) > => "2025-01-06 W02" That indeed explains it - %W and %V are apparently not the same and `calendar-iso-to-absolute' is closer to %V. > Maybe just starting the week on Monday does not guarantee that the > result is an ISO commercial date? Unless you see some error I am not seeing here, this is probably not a bug, but my misunderstanding. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 28 12:43:36 2025 Received: (at 78096) by debbugs.gnu.org; 28 Apr 2025 16:43:36 +0000 Received: from localhost ([127.0.0.1]:33231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u9RZw-0004iA-Fs for submit@debbugs.gnu.org; Mon, 28 Apr 2025 12:43:36 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:37124) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u9RZr-0004gp-Cs for 78096@debbugs.gnu.org; Mon, 28 Apr 2025 12:43:33 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4ZmTm11Zbbz1r6nC; Mon, 28 Apr 2025 18:43:28 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 4ZmTm06m8qz1qqlS; Mon, 28 Apr 2025 18:43:28 +0200 (CEST) X-Virus-Scanned: amavis at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavis, port 10024) with ESMTP id hRFQ_5sR6eDD; Mon, 28 Apr 2025 18:43:18 +0200 (CEST) X-Auth-Info: yKvQ7G4FQQbvtZxH8lT5y2f1AV2ZghyoWVPJu1OMtVygRtibpnJP+o7sywRJP5xs Received: from igel.home (aftr-82-135-83-154.dynamic.mnet-online.de [82.135.83.154]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 28 Apr 2025 18:43:18 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 4291F2C1DFE; Mon, 28 Apr 2025 18:43:18 +0200 (CEST) From: Andreas Schwab To: Ihor Radchenko Subject: Re: bug#78096: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent In-Reply-To: <87tt68fezs.fsf@localhost> (Ihor Radchenko's message of "Mon, 28 Apr 2025 16:05:43 +0000") References: <87ldrlpqs4.fsf@localhost> <87o6whwc1p.fsf@gmx.net> <87tt68fezs.fsf@localhost> Date: Mon, 28 Apr 2025 18:43:18 +0200 Message-ID: <87tt685ja1.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 78096 Cc: Stephen Berman , 78096@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Apr 28 2025, Ihor Radchenko wrote: > Stephen Berman writes: > >> The doc string of `format-time-string' says: >> >> %U is the week number starting on Sunday, %W starting on Monday, >> %V the week number according to ISO 8601. >> >> (format-time-string >> "%Y-%m-%d W%V" >> (encode-time (parse-time-string "2025-01-06 00:00"))) >> => "2025-01-06 W02" > > That indeed explains it - %W and %V are apparently not the same and > `calendar-iso-to-absolute' is closer to %V. The difference is that %V is always the same for the whole week, whereas %V and %W roll over on 01-01 (and use 0 for a partial first week). $ for y in $(seq 2020 2025); do date -d "$y-01-01" +"%a %U %V %W"; done Wed 00 01 00 Fri 00 53 00 Sat 00 52 00 Sun 01 52 00 Mon 00 01 01 Wed 00 01 00 -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat May 10 05:52:25 2025 Received: (at 78096-done) by debbugs.gnu.org; 10 May 2025 09:52:25 +0000 Received: from localhost ([127.0.0.1]:44090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDgsb-0001DW-DG for submit@debbugs.gnu.org; Sat, 10 May 2025 05:52:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50936) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDgsZ-0001DF-Ff for 78096-done@debbugs.gnu.org; Sat, 10 May 2025 05:52:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDgsT-0003XI-4j; Sat, 10 May 2025 05:52:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TYMpP3ANd1yz/TKYbr7znaMmgQECMod7czGL9hOzim8=; b=PuCU6lxMC4QJ FKk5x7wbDioEzU8Zg+PiVj4pEBhNWiRuoH/Bzd8Mz4DQKR6jSc38qFRfDA6/fwdcd+8IMyMXpGBN2 eLPb25LQ2Ay2Md9dBc+kb/n8Nn9InbPCp/x2JIMrhlLseCqRayYWqMRdyhpLQPgXFlngW+Gav+xVZ UKqA5cj2rEJO/gyOGki+w2ABR+zjinqcjOHlWIiUSen2YSDfzlxGekDtE/GszF4j0fLpfEU6hWZed P32phpHuoPrCBdmA9M6S8PiboVIBDdFs1PocuJyTZAWFGVrHZ9sT1Gj652S4Cqe7yLeOTP1C/5DBf Ll12+epnzxXTlgyBPJZ0Og==; Date: Sat, 10 May 2025 12:52:14 +0300 Message-Id: <86selcaj3l.fsf@gnu.org> From: Eli Zaretskii To: Andreas Schwab In-Reply-To: <87tt685ja1.fsf@igel.home> (message from Andreas Schwab on Mon, 28 Apr 2025 18:43:18 +0200) Subject: Re: bug#78096: 31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent References: <87ldrlpqs4.fsf@localhost> <87o6whwc1p.fsf@gmx.net> <87tt68fezs.fsf@localhost> <87tt685ja1.fsf@igel.home> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 78096-done Cc: yantar92@posteo.net, stephen.berman@gmx.net, 78096-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: Stephen Berman , 78096@debbugs.gnu.org > From: Andreas Schwab > Date: Mon, 28 Apr 2025 18:43:18 +0200 > > On Apr 28 2025, Ihor Radchenko wrote: > > > Stephen Berman writes: > > > >> The doc string of `format-time-string' says: > >> > >> %U is the week number starting on Sunday, %W starting on Monday, > >> %V the week number according to ISO 8601. > >> > >> (format-time-string > >> "%Y-%m-%d W%V" > >> (encode-time (parse-time-string "2025-01-06 00:00"))) > >> => "2025-01-06 W02" > > > > That indeed explains it - %W and %V are apparently not the same and > > `calendar-iso-to-absolute' is closer to %V. > > The difference is that %V is always the same for the whole week, whereas > %V and %W roll over on 01-01 (and use 0 for a partial first week). > > $ for y in $(seq 2020 2025); do date -d "$y-01-01" +"%a %U %V %W"; done > Wed 00 01 00 > Fri 00 53 00 > Sat 00 52 00 > Sun 01 52 00 > Mon 00 01 01 > Wed 00 01 00 AFAIU, this bug report was based on a misunderstanding of the subtleties of time formats. I've updated the documentation to clarify the differences between these formats, and I'm therefore closing this bug. From unknown Sun Jun 22 03:57:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 07 Jun 2025 11:24:18 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator