Bug 146954 - CSV import not recognizing ISO 8601 date+time with timezone (regression, on purpose, earlier the timezone was simply discarded)
Summary: CSV import not recognizing ISO 8601 date+time with timezone (regression, on p...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.2 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2022-01-24 07:53 UTC by Mikeyy - L10n HR
Modified: 2023-05-24 15:11 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Test file (151 bytes, text/csv)
2022-01-24 09:33 UTC, Mikeyy - L10n HR
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikeyy - L10n HR 2022-01-24 07:53:40 UTC
I have ods file created with older LO versions, which use (Sheet - Link to outside data...) and pull data from CSV file.
It worked without issues in 7.2.5, but when I upgraded to 7.3.0.2 date isn't recognized.

This is sample data:
2022-01-22T06:50:59.400Z,buy,XYZ,36.991,16,591.856,USD,-0.373905028,1.1351
2022-01-22T10:57:25.501Z,buy,ZYX,33.968,8.8,298.9184,EUR,-0.0015884,1.13275

When linking CSV for first time, first column (date/time) was marked as "Date (YMD)", while columns 4, 5, 6, 8 and 9 were marked as US ENGLISH.
This automatically converted first column to DATE format, and other columns to NUMBER format.

As of 7.3.0.2 conversion to DATE isn't working any more (it just shows text string as it is), while conversion to NUMBER seams ok.
Comment 1 Xisco Faulí 2022-01-24 09:03:50 UTC Comment hidden (obsolete)
Comment 2 Mikeyy - L10n HR 2022-01-24 09:33:26 UTC
Created attachment 177735 [details]
Test file

Hello, sample data was provided in comment #1.
I just saved in inside blank test.csv file. You can link file, then change csv file (copy last line, paste as new line, and change just starting date/time for example) and reload .ods file to see how it pulls new data.
Comment 3 Xisco Faulí 2022-01-24 12:22:02 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=9bcdfcb74dae7ccd07be7159c0e1deba110d2a6f

author	Eike Rathke <erack@redhat.com>	2021-10-14 23:28:11 +0200
committer	Eike Rathke <erack@redhat.com>	2021-10-15 01:38:55 +0200
commit 9bcdfcb74dae7ccd07be7159c0e1deba110d2a6f (patch)
tree 649dde1449bb7ddd92e71bbbe2b2a7a50d9fd0f6
parent a12727702b4132bb0576062afe68e39a87a6a426 (diff)
Related: tdf#88359 CSV: choose proper ISO date(+time) format if detected

Bisected with: bibisect-linux64-7.3

Adding Cc: to Eike Rathke
Comment 4 Eike Rathke 2022-01-25 12:36:51 UTC
While it's true that earlier versions accepted and ignored a timezone present in an ISO 8601 date+time, it's questionable that they did so, because there are no means to store the timezone information, it was simply discarded, which is a data loss. The commit message mentions that,
"Also be more strict if ISO is detected and timezone is included
keep it as type Text instead of silently discarding the timezone
information."