Calendar dates don't display properly

Calendar dates don’t sort or display correctly when importing CSV files. Example:

|31/10/2025|05:50:12|PDT|
|31/10/2025|05:50:12|PDT|
|31/10/2025|05:50:12|PDT|
|2025-03-11|08:57:41|PST|
|2025-10-11|18:45:29|PST|
|13/11/2025|09:53:13|PST|
|2025-03-12|15:55:14|PST|
|2025-03-12|15:55:14|PST|
|2025-03-12|15:55:14|PST|

This bug has been there for at least 10 years. Is there anyway that it can be sorted out properly? The end result works OK, but it’s really clumsy to work with (and doesn’t impress the clients!)

I don’t think it’s a bug, but rather a matter of selecting the right options.

Thanks for the interest. The basic text import appears to be OK, all in correct order, everything in order - but in “MDY” format (which is in itself clumsy to work with). It’s after L/O “YMD” display format is selected that the resulting display is as you see it. In other words, L/O mucks it up after changing the display format. It appears to be that the underlying tools are mostly unchanged since OO/LO took over the application from Oracle/Sun 25 or so years ago. I’m guessing that since the Europeans never use ISO dates that perhaps they’ve never noticed that something’s out of date! FWIW, Excel can manage the task, but I prefer using L/O (except for this bug). I just don’t know how to bring it to the attention of the boffins in the back room.

My solution is to do all the work in L/O, save the file, and then open it in Excel so it displays correctly. But it should be fixed.

What exactly is your locale; what exactly do you choose in Text Import dialog; and what is the exact problem you see after that - with screenshots? Up to now, you provide “analysis”, but no description of the problem (I do specifically this, and I get that).

You wrote several times: “format”. Once it even was “YMD” display format - and that seems to tell that you think, that in the import dialog, you ignore the words “Column type”, and imagine that you set up there some “display” settings. No you do not. In the import dialog, you only tell Calc how to import - meaning “detect parts of the date in the text of the CSV”; and all formatting will happen only after the import, in the normal UI. If you choose the correct settings, the dates will be detected correctly: the ISO dates are always detected, when you check the “Detect special numbers” checkbox in the dialog; and the non-ISO dates like “31/10/2025” require the “DMY” in the respective column (not because you want them to display that way, but because you want Calc to know, that in those dates in the CSV, the first part is day, then month, then year).

With those settings, you get a column with differently formatted dates, but all are dates, and will sort correctly (as dates, not as text); and you would also be able to format them uniformly - by configuring cell format (or better style).

No, the change in formatting only reveals, where the import was not done right. For education try to set the column to a simple number: Values importrs as text/string will not follow. “True” dates will show a number of days since beginning of the 20th century (I skip details).
.
The other rule to notice is: Format will never change a type of data, only what is shown. (So a phone “number” as text +4912346 or 00111344 will not change.)

and users and developers at Sun / Oracle never stumbled over this after they bought StarOffice? Nobody noticed until now?
.
“Europe” is using iso-date for the same purpose as americans: You can easily sort the textual representation of dates.

2 Likes

If you’ve ever tried to do this, you’d see that the result is a mix of date formats, regardless of which toggles were set. The results, unbelievably, even include Ukrainian (“D-M-Y”) date formats! I’m only thankful the L/O doesn’t make us try to decode Zoroastrian date formats by selecting “Magic Numbers”!

One import step missaed… The date column is still in Text format

  • in the text import dialog find the date column in the import preview at the bottom.
  • select the date column and then select Column type: Date(D/M/Y) This converts the column data from text with format “dd/mm/yyyy” to the default date format (probably “mm/dd/yy”). You can change the date format using the regular “format cells” method after importing.

This can also be done after the import by selecting the date column then:

  • goto Data tab menu
  • select “Text to columns”
  • in the dialog window, follow the process described above

Are you sure? The imported column shown in the screenshot by @mariosv is adjusted to the right, while text would be left-aligned.
.
The key point in the screenshot is the “detect special numbers”. The other selicting a locale fitting to the dates, not in iso-format.

Text may be aligned to the left, center right, and dates and numbers may be aligned left, center, right if the cell alignment has been edited. Anytime I import a csv into calc I have to “convert” a Text formatted date like “dd/mm/yyyy” into a calc date format by using the Text to Columns feature during import. It is very quick and simple.

Agreed, it is simple. But I still think it is unnecessary, as you can set the right settings directly in the import dialogue. (Select the column header, then set appropiate “column-type”-value in the drop-down directly above.)

We have both described the exact same import feature… “Text to Columns” dialog window.

This is not correct. The process is defective as shown by the inconsistent results in actual practice. Some of the dates respond properly, but others don’t. I’m suspecting that L/O and others are still using old Sun Micro source code from 20 years ago, and not bothering to keep up with new methods. This is not rocket science, and we should not be trying to manage our businesses with old, out-of-date European applications.From the user perspective, L/O can handle the size of the CSV import, but can’t deal with the dates. Excel can’t handle the large CSV files but CAN do the dates. You’re suggesting that I have to know how to deal with the L/O quirks when importing CSV files. I don’t buy that. If Excel can do the import/conversion, then it’s a “known known”, and L/O should do its homework and stop blaming the user.

Actually I don’t see a need for “new methods” since 1583 (or since the date a locale uses the gregorian calendar). I have ti admit Microsoft didn’t get this right at first and the creative work-around to base dates a 1904 has not really helped, but a correct implementation of 1984 should work now flawless. (But I will have a hard time to find a working Apple II with UCSD-Pascal to check, if my old floppies would be readable.)
.
I left MS-Office because it would not handle my files correctly on import (unless I prepared them precisely as Excel expected them), while OpenOffice did ask me to help or confirm imports, what I still prefer.

If Excel imports your stuff correctly use it, but don’t use “known” for a closed source system. The behaviour of Excel may be reverse-engeniered to be known but unlike OpenSource-software there is nothing really “known” on internals.
All this would prove is “this kind of settings is possible”, not that this is an accepted solution for everybody.

But I can do this: If you present a messed up input of at least 2 formats of dates in one table-column, why do you even expect LibreOffice to clean this up?
This is actually a sign to have the source inspected, if there are more messed up dates included, where nobody can detect the rules to import without knowledge of the origins.

A csv file is loaded into a blank, unformatted sheet. Dates aligned to the left are text.

It is dangerous and not as quick as doing it right in the first place. If your locale happens to be English(USA), your dd/mm/yyyy dates are interpreted as mm/dd/yyyy, which gives a mixture of wrong dates and text where the day is bigger than 12.