Bug 94643 - FILESAVE : Date format lost when exporting to XML
Summary: FILESAVE : Date format lost when exporting to XML
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: MSO-XML2003
  Show dependency treegraph
 
Reported: 2015-09-30 14:35 UTC by jmgigandet
Modified: 2023-07-06 13:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (2.08 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-09-30 14:35 UTC, jmgigandet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jmgigandet 2015-09-30 14:35:35 UTC
Created attachment 119140 [details]
Test file

Same as bug 88019 which has been closed.
When saving an XML (text) spreadsheet, date format is lost.
Attached an example file.
- Open the file.
- Date is show in short date format.
- Change the date format of the cell to DD/MM/YYYY (european format).
- Save.
- Re-open.
- Date format has been lost.
Comment 1 raal 2015-10-01 16:40:31 UTC
I can confirm with Version: 5.1.0.0.alpha1+
Build ID: 83ef294dddf3b1ab5cd5f91a792a7d9413a08f1f
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-09-20_07:00:46
Comment 2 QA Administrators 2016-11-08 10:39:27 UTC Comment hidden (obsolete)
Comment 3 jmgigandet 2016-11-08 11:07:46 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2017-11-09 07:43:43 UTC Comment hidden (obsolete)
Comment 5 jmgigandet 2017-11-09 08:49:02 UTC
Bug is still present on 5.3.7.2 (Win 7 x64 pro) and 5.4.2.2 (MacOSX 10.11.6)
Comment 6 Timur 2018-11-01 17:03:39 UTC Comment hidden (obsolete)
Comment 7 Timur 2018-11-01 18:10:18 UTC
"- Date is show in short date format." probably means 7-9-15.
"- Save." Now it's "Export to XML".

Bug repro with Lo 6.0. Cannot be tested with 6.2+ due to fileopen Bug 103024.
Comment 8 Timur 2019-09-02 09:59:39 UTC
If we open attched  Bug_Date_Format.xml we can see:
	<NumberFormat ss:Format="Short Date"/>
It remains the same after resave. Repro 6.4+ and OO so I set Inherited.
In Excel, this is changed to: 
   <NumberFormat ss:Format="[$-1141A]dd/mm/yyyy;@"/>
Comment 9 QA Administrators 2021-09-02 03:53:20 UTC Comment hidden (obsolete)
Comment 10 Diana Vides 2023-07-06 03:32:05 UTC
This bug does not exist in version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 6; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_US); UI: en-US
Calc: threaded

Also, it does not exist in version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 105f057f5b994b7d79a55ca719240839c2d45b54
CPU threads: 6; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded
Comment 11 ady 2023-07-06 11:31:43 UTC
(In reply to Diana Vides from comment #10)
> Also, it does not exist in version: 24.2.0.0.alpha0+

I'm not sure about this. The resulting XML export, when reloaded in Calc, shows the content of the cell as expected, but the number format ([CTRL]+[1]) does not match DD/MM/YYYY. I'm not sure whether this is "normal". Maybe some additional attribute is required in order to actually save the number format too? Perhaps locale-related?

I'm re-setting this to NEW.

Additionally, if this were to be set as RESOLVED at this moment, it would not be FIXED but rather WORKSFORME, because the commit(s) that solve this are unknown.
Comment 12 ady 2023-07-06 11:50:54 UTC
(In reply to ady from comment #11)
> (In reply to Diana Vides from comment #10)
> > Also, it does not exist in version: 24.2.0.0.alpha0+
> 
> The resulting XML export, when reloaded in Calc,
> shows the content of the cell as expected

I must correct the above statement, to be accurate. The original value of September 7th:

1. Changed to be shown as 07/09/2015, DD/MM/YYYY,
2. Saved as a new XLSX, 
3. Close and reopen the new XLSX file,
4. Export as XML,
5. Close and open the new XML file

...shows the value as 9/7/2015 and format as M/D/YYYY.

From the original XLSX file attached in comment 0, I tested changing the original value to 30/07/2015 in DD/MM/YYYY format and repeating the whole set of steps. The resulting XML file, opened in Calc, shows the same 30/07/2015 value but with M/D/YYYY format, which is not consistent (and an invalid date).
Comment 13 Diana Vides 2023-07-06 13:32:51 UTC
(In reply to ady from comment #12)
> (In reply to ady from comment #11)
> > (In reply to Diana Vides from comment #10)
> > > Also, it does not exist in version: 24.2.0.0.alpha0+
> > 
> > The resulting XML export, when reloaded in Calc,
> > shows the content of the cell as expected
> 
> I must correct the above statement, to be accurate. The original value of
> September 7th:
> 
> 1. Changed to be shown as 07/09/2015, DD/MM/YYYY,
> 2. Saved as a new XLSX, 
> 3. Close and reopen the new XLSX file,
> 4. Export as XML,
> 5. Close and open the new XML file
> 
> ...shows the value as 9/7/2015 and format as M/D/YYYY.
> 
> From the original XLSX file attached in comment 0, I tested changing the
> original value to 30/07/2015 in DD/MM/YYYY format and repeating the whole
> set of steps. The resulting XML file, opened in Calc, shows the same
> 30/07/2015 value but with M/D/YYYY format, which is not consistent (and an
> invalid date).



I am sorry, and thanks ady for providing more details. I followed the new steps, and now I can replicate the bug.  
Version: 7.5.3.2 (X86_64) / LibreOffice Community
Build ID: 9f56dff12ba03b9acd7730a5a481eea045e468f3
CPU threads: 6; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_US); UI: en-US
Calc: threaded