GNU bug report logs - #78096
31.0.50; calendar-iso-to-absolute and %W time string format are inconsistent

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Sun, 27 Apr 2025 15:30:02 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; calendar-iso-to-absolute and %W time string format are
 inconsistent
Date: Sun, 27 Apr 2025 15:28:43 +0000
Hi,

This bug was originally reported in
https://orgmode.org/list/174544167676.8.6104466990232889732.690779499 <at> 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 <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.