Bug 139934 - FILEOPEN: Date is shown as an integer
Summary: FILEOPEN: Date is shown as an integer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.6.0 target:7.4.6 target:7.5....
Keywords:
Depends on:
Blocks: XLSX-External-Generators
  Show dependency treegraph
 
Reported: 2021-01-27 00:05 UTC by Jan Kratochvil
Modified: 2023-05-05 19:48 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
.xlsx (5.84 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-01-27 00:06 UTC, Jan Kratochvil
Details
.csv correct from GoogleOffice (5.22 KB, text/plain)
2021-01-27 00:06 UTC, Jan Kratochvil
Details
.csv incorrect from LibreOffice (4.92 KB, text/plain)
2021-01-27 00:07 UTC, Jan Kratochvil
Details
Comparison LibreOffice 7.2 master and MSO 2010 (241.58 KB, image/png)
2021-01-28 09:51 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kratochvil 2021-01-27 00:05:29 UTC
Description:
.xlsx dates 1/19/2021 and 1/20/2021 are shown correctly both by MS Excel and Google Office.
LibreOffice shows them as 44215 and 44216.


Steps to Reproduce:
Open Jan_Kratochvil.xlsx


Actual Results:
44215

Expected Results:
1/19/2021


Reproducible: Always


User Profile Reset: No



Additional Info:
libreoffice-calc-7.0.4.2-3.fc33.x86_64

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: gtk3
Locale: cs-CZ (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Jan Kratochvil 2021-01-27 00:06:07 UTC
Created attachment 169169 [details]
.xlsx
Comment 2 Jan Kratochvil 2021-01-27 00:06:50 UTC
Created attachment 169170 [details]
.csv correct from GoogleOffice
Comment 3 Jan Kratochvil 2021-01-27 00:07:21 UTC
Created attachment 169171 [details]
.csv incorrect from LibreOffice
Comment 4 BogdanB 2021-01-27 10:47:13 UTC
In your xlsx file the dates are saved as number, and not as dates.

A number is exported to a csv file as a number.
Comment 5 Jan Kratochvil 2021-01-27 10:52:06 UTC
(In reply to BogdanB from comment #4)
> In your xlsx file the dates are saved as number, and not as dates.

So why MS Excel + Google Office show those "numbers" as dates?
Comment 6 BogdanB 2021-01-28 05:46:40 UTC
I tested with import in Google Drive, indeed it transform the number into dates.
Comment 7 Xisco Faulí 2021-01-28 09:51:19 UTC
Created attachment 169220 [details]
Comparison LibreOffice 7.2 master and  MSO 2010
Comment 8 Xisco Faulí 2021-01-28 09:53:00 UTC
Reproduced in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: f2389a70da606768a39ee599de6a5b24058734aa
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 5.7; Render: default; 

and

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 9 Xisco Faulí 2021-01-28 09:53:23 UTC
@Eike, I thought you might be interested in this issue
Comment 10 Eike Rathke 2021-01-28 12:23:21 UTC
The .xlsx attached here is in the old Excel interim XML file format that LibreOffice only partially supports, and number formats given as some default format IDs with cellXfs
<xf numFmtId="..." ...>
apparently are not supported by this filter.

To solve the problem, save the file in Excel once in the standard OOXML .xlsx format and it likely will work also in LibreOffice. Or apply the date format in LibreOffice and save as Excel 2007-365 .xlsx, which should fix things as well.
Comment 11 Jan Kratochvil 2021-01-28 13:01:00 UTC
This format is "Excel export" from https://www.workday.com (which is now being deployed inside Red Hat company). So I do not have an option to choose a different format. Except for using other offices to convert it afterwards.
There are many workarounds but at the end of the day LibreOffice is incompatible while MS Excel + Google Office are compatible.
Comment 12 QA Administrators 2023-02-06 03:19:21 UTC Comment hidden (obsolete)
Comment 13 Jan Kratochvil 2023-02-06 04:08:00 UTC
still valid for: 7.3.7.2
libreoffice-calc-7.3.7.2-2.fc36.x86_64
(I have tried to download and install your 7.5 but it did not start for me on Fedora 36 x86-64.)
Comment 14 Commit Notification 2023-02-07 13:18:20 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/909a25d30b09ebd3a023105a9c3cc4d20add094a

Resolves: tdf#139934 always apply cellXfs xf explicits (tdf#123139 related)

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Eike Rathke 2023-02-07 13:20:23 UTC
Pending review
https://gerrit.libreoffice.org/c/core/+/146533 for 7-5
https://gerrit.libreoffice.org/c/core/+/146614 for 7-4
Comment 16 Commit Notification 2023-02-10 19:50:54 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d367cefb0281767762b1671c03b3852cf3d1b7ab

tdf#139934: sc_subsequent_filters_test: Add unittest

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 BogdanB 2023-02-11 11:15:45 UTC
Thanks Eike for fixing this one and Jan for reporting.

Verified. OK now in
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 9d44236a62bf59d120dda89924d0d1407b2bd52b
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 18 Jan Kratochvil 2023-02-11 14:05:08 UTC
Thanks for the fix.
Unfortunately the nightly builds do not work for me on either Fedora 36 or Debian 12 (x86_64).
It looks the next release with native distro packaging will be fixed already.
Comment 19 Commit Notification 2023-02-13 11:53:07 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/e53c02eac4b3d231fef7a6156321edfdea1fbb27

Resolves: tdf#139934 always apply cellXfs xf explicits (tdf#123139 related)

It will be available in 7.4.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 20 Commit Notification 2023-02-13 11:53:12 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/321c1a6db442a6d2afee25d1d1256ff36bdb004e

Resolves: tdf#139934 always apply cellXfs xf explicits (tdf#123139 related)

It will be available in 7.5.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 21 Commit Notification 2023-02-22 18:34:28 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-5-1":

https://git.libreoffice.org/core/commit/58c84f408c4a2d5f1067b4ca5e7c204d6a9c9372

Resolves: tdf#139934 always apply cellXfs xf explicits (tdf#123139 related)

It will be available in 7.5.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.