Bug 170164 - Wrong year when formatting date as ISO week number
Summary: Wrong year when formatting date as ISO week number
Status: NEEDINFO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
24.8.7.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-29 16:07 UTC by throwaway_account
Modified: 2026-01-18 03:12 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description throwaway_account 2025-12-29 16:07:38 UTC
Description:
Date fields may have the incorrect year when using ISO week number formatting.

Steps to Reproduce:
* Open LibreOffice Writer
* Create a new document or open an existent one
* Insert a date field. The date field value should be 2025-12-29, 2025-12-30, or 2025-12-31.
* Format the field as:
  - Category: Date
  - Format code: YYYY"W"WW (scroll to "Additional formats…" at the bottom of the list of formats)
* OK all relevant dialogues

Actual Results:
It returns 2025W1

Expected Results:
It should return 2026W01


Reproducible: Always


User Profile Reset: No

Additional Info:
Obviously, the year is off by one. Even though the date *is* in 2025, when used along with the ISO week number, the year should be consistent with the ISO week. Note that it could be:

* One year less than the calendar year (2027-01-02 = 2026W53)
* The same year as the calendar year (2026-12-30 = 2026W53, 2028-12-29 = 2028W52, 2029-01-01 = 2029W01)
* One year more than the calendar year (2025-12-29 = 2026W01)

NB: Note also that the ISO week number is supposed to be written as two digits, so with a "0" prefix if necessary.
Comment 1 throwaway_account 2025-12-29 16:08:05 UTC
Version: 24.8.7.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 16; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 2 Dieter 2026-01-17 16:04:47 UTC
Throwaway, thank youfor reporting the bug. Do you have any idea, how to reproduce it now?
=> NEEDINFO