Avoid apostrophes in libreoffice calc

I have a column with dates in AAAA-MM-DD format. Some cells appear to work right, but others include an apostrophe at the beginning. When changing their format to text (@) the ’ character disappears, but when turning it back to date it appears again. The problem is not the apostrophe itself, but its consequences when sorting, as this character is not present in all cells. Here’s an example:

1281-11-20 [1281-11-20]
1282-06-11 [1282-06-11]
1252-12-03 ['1252-12-03]
1254-01-04 ['1254-01-04]

I’ve already tried to copy the whole column and paste it as simple text in another place, but the problem persists.
Hope you can help.
Thanks!

How did the dates get into your sheet - are you performing an import from another source? Generally this can’t happen if you manually enter those dates, since your format is ISO 8601, which is / should be correctly recognized in all locales.

Note Formatting will never help in such case. Formatting never changes the data type and if something is imported as data type “Text” it will keep to be data type “Text” until you convert the content to some other data type (e.g. see Data -> Text to Columns, which can be used to convert “Text” to “Numbers” - and dates are in fact numbers; 1254-01-04 is -235934, which is the 235934th day before 1899-12-30).

If the ' is not part of the cell content but only displayed in the Input Line (apparently you use the [] notation for that) then see this FAQ. Data that could be converted to numeric or date(+time) but is content of a text formatted cell is prefixed with a ' when editing to indicate exactly that.