Bug 170107 - Many text strings dates formats recognized by Excel are not parsed by LibreOffice Calc's DATEVALUE function
Summary: Many text strings dates formats recognized by Excel are not parsed by LibreOf...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL: https://docs.oasis-open.org/office/Op...
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: ODF-import
  Show dependency treegraph
 
Reported: 2025-12-23 22:01 UTC by Jeff F.
Modified: 2026-02-15 14:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file (7.60 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-12-23 22:01 UTC, Jeff F.
Details
Screenshot of the DATEVALUE function's in-GUI documentation (93.99 KB, image/png)
2026-01-09 15:01 UTC, Jeff F.
Details
One of the several "date" formats as text argument that DATEVALUE() should accept according to ODF (11.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2026-01-24 22:18 UTC, ady
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff F. 2025-12-23 22:01:04 UTC
Created attachment 204779 [details]
Sample file

I wanted to parse a bunch of cells (from a CSV) that have text contents like "22 Dec 2024", but Calc's "DATEVALUE" function doesn't handle that. As it turns out, Calc's DATEVALUE function doesn't handle most formats that Excel would recognize, either.

From the table in https://support.microsoft.com/en-us/office/datevalue-function-df8b07d4-7761-4a93-bc33-b7471bbff252 we can see a couple of examples of expected formats to be supported.

For easy testing:

=DATEVALUE("8/22/2011")
=DATEVALUE("22-MAY-2011")
=DATEVALUE("2011/02/23")
=DATEVALUE("5-JUL")
=DATEVALUE(A2 & "/" & A3 & "/" & A4)
=DATEVALUE("22 Dec 2024")
=DATEVALUE("22-DEC-2024")

…the only one that works is the first one, "8/22/2011" parsed as "2011-08-22".
All the others show "Err:502" in the cell.

I have created and attached a sample file that demonstrates the problem, with their formats and mine.

With the same sample file, Gnumeric has no problem parsing these formats.

---

Observed on:

Version: 25.8.4.2 (X86_64) / LibreOffice Community
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 8; OS: Linux 6.17; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Flatpak
Calc: threaded
Comment 1 raal 2026-01-07 07:09:53 UTC Comment hidden (off-topic)
Comment 2 Jeff F. 2026-01-09 15:01:29 UTC Comment hidden (off-topic)
Comment 3 Jeff F. 2026-01-19 15:29:31 UTC Comment hidden (off-topic)
Comment 4 ady 2026-01-23 10:42:39 UTC
Although attachment 204779 [details] is not a good example (as cells C4:C10 are formatted as Dates, not as Text), I have always considered this issue to be some kind of bug (or lack of adequate / complete implementation).

For instance, a date pattern such as "DD mmm YYYY" (in Text format) is supposed to be accepted according to:

 <https://docs.oasis-open.org/office/OpenDocument/v1.4/OpenDocument-v1.4-part4-formula.html#VALUE> 

(where the DATEVALUE section of the document points to see the Date patterns to be accepted).

There are _many_ patterns that the OASIS doc mentions but LO Calc does not accept (Error:502).

This is not about the Date acceptance pattern in LO's Options either. I think users should not be required to manually add each and every possible (alternative, equivalent) pattern to the "Date pattern acceptance" setting (in Options > Languages and Locales) that the DATEVALUE and VALUE function(s) are supposed to accept, since these patterns are Text, which is different than telling Calc which pattern it should automatically recognize as dates.

To be clear, the problem is not that you cannot import such patterns into Calc (which, you can), but that the DATEVALUE (and VALUE) functions don't parse them as valid dates (in text format) as they should according to the ODF standard. Also, Excel has nothing to do with this (other than improving compatibility with other spreadsheet tools). The subject of this bug report should be modified accordingly.

I am therefore changing this issue to Enhancement Request, although this report might be a duplicate of some other older request that might specify each and every date pattern that DATEVALUE is currently not supporting, but it should according to the ODF standard.
Comment 5 ady 2026-01-24 22:18:10 UTC
Created attachment 205165 [details]
One of the several "date" formats as text argument that DATEVALUE() should accept according to ODF
Comment 6 ady 2026-01-24 22:26:50 UTC
I have attached a basic test spreadsheet for DATEVALUE() (created with AOO 4.1.15, where it works as expected).

1. Open attachment 205165 [details]
2. Recalculate Hard (or Recalculate on cell E11, if the first is not available)


Versions I tested (on Windows 10):


DATEVALUE() OK (thus, probably a REGRESSION):
_ ApacheOpenOffice 4.1.15
_ LibreOffice 3.3.0


DATEVALUE() fails on cell reference, but OK on direct text:
_ LO 4.0.0.3
_ LO 5.0.6.3


DATEVALUE() fails on both, cell reference and on direct text:
_ LO 6.0.4.2
_ LO 7.0.0.3
_ recent master of LO 26.8

Probably the same happens with VALUE().

It would be nice if someone (like Mike K.) could take a look at attachment 205165 [details] as (one) example of formats that were supposed to work for DATEVALUE() (and VALUE()) according to ODF.

When re-saving attachment 205165 [details] as a different file with a recent LO master 26.8, and then checking it with odfvalidator:

datevalue_lo268a.ods/content.xml[2,11088]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,11484]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,12968]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,13609]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,13928]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,14247]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,14790]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,15094]: Error: unexpected attribute "calcext:value-type"
datevalue_lo268a.ods/content.xml[2,15574]: Error: unexpected attribute "calcext:value-type"

among other odfvalidator errors.