Bug 159740 - Wrong month displayed for a date in formula MONAT / MONTH with format MMMM
Summary: Wrong month displayed for a date in formula MONAT / MONTH with format MMMM
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-15 19:09 UTC by Martin
Modified: 2024-02-15 20:09 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Format MMMM, wrong month name (47.70 KB, image/png)
2024-02-15 19:09 UTC, Martin
Details
Format as decimal number, month number is correct (40.21 KB, image/png)
2024-02-15 19:10 UTC, Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2024-02-15 19:09:37 UTC
Created attachment 192591 [details]
Format MMMM, wrong month name

Cell A1 contains a date in the format DD.MM.YYYY and I want to display the name of the month in cell B1.

I use the function =MONTH() for this. If B1 is formatted as a decimal number, the month number is displayed correctly.

However, if I format B1 as "MMMM", the month name is not correct.

Example: A1 = "04.01.2024", B1 = "December"
"January" in B1 would be correct.

I use the German version of LibreOffice. It is therefore possible that I have not translated format specifications or formulas correctly.
Comment 1 Martin 2024-02-15 19:10:41 UTC
Created attachment 192592 [details]
Format as decimal number, month number is correct
Comment 2 Eike Rathke 2024-02-15 20:09:52 UTC
Do not format a month number as month, but a date instead. e.g. in C2 simply have =A2 and apply the MMMM number format.

A value of 1 would be the date serial number of nulldate+1 so 1899-12-30 + 1 = 1899-12-31 => December, a value of 2 the date serial number of nulldate+2 so 1899-12-30 + 2 = 1900-01-01 => January.