Why does LO change a date format?

asked 2019-03-17 23:10:15 +0200

TAB gravatar image

Template Livre.ott C:\fakepath\Livre.ott was made and stored by OpenOffice, which reads it back with the correct date format yyyy-mm-dd. But LibreOffice changes the format to mm/dd/yyyy. It does the same thing with a file based on Livre.ott. Why? How to avoid this?

edit retag flag offensive close merge delete

Comments

I used your template to create an untitled new document.
The template has the document language English (USA), Thus a default date format following the (bad) regional usage in USA should be excpected. The one TextField showing a date, however, has set the foramt YYYY-MM-DD, and on my Win10 system with my LibO V 6.2.0.3 it actually displays the date in this fornat.
My UI language and my locale are both English (UK).
What are your settings? What OS, LibO version?
Probably a document newly created from the template on your system migh help to analyze the issue.

Lupp gravatar imageLupp ( 2019-03-17 23:52:17 +0200 )edit

In my Fedora Linux 28 and LO 6.0.7.3,field template opens as yyyy-mm-dd, which seems to be the format specified for the field.

You may have problems with your locale and the way it is managed by the OS (see @Lupp's question about this information). From your template name, you probably live in a French speaking country. All text in your template and documents derived from it, inherit from Default StyleFont's language attribute, which itself inherit from Tools>Options, LibreOffice Writer>Language Settings. Since you set nothing, you get either the English (USA) default or what could be guessed from OS locale probing.

ajlittoz gravatar imageajlittoz ( 2019-03-18 14:11:00 +0200 )edit

@ajlittoz: After all I don't understand how a date-TextField being explicitly set to a non-default date format (as YYYY-MM-DD strangely is for most locales) should be reverted to any default later. It neither was on my system nor on yours.
Corrupted user profiles sometimes cause very strange effects, however...

Lupp gravatar imageLupp ( 2019-03-18 14:20:34 +0200 )edit

@Lupp: I don't understand either. Problems arise usually when you don't explicitly set something or when you explicitly force something instead of resetting to default (the famous Standard button), which isn't the case here apparently.

ajlittoz gravatar imageajlittoz ( 2019-03-18 15:45:24 +0200 )edit

LibO stores the date using the international standard, which if my memory is correct is in seconds date from 1970-00-00. Hence, what you are modifying is the way to display this actual date not the date itself. The default display of dates is YYYY/MM/DD.

You can control the default display of dates using (on my Linux System) TOOLS > OPTIONS > LANGUAGE SETTINGS > LANGUAGES > DATE ACCEPTANCE PATTERNS. Differences in dates between English (UK) and English (US) are visible there. Also for example Gregorian, Jewish, Chinese which have their own formats but using the same actual date.

Other languages, such as German may use their own letters for dates, after all YYYY is in English.

petermau gravatar imagepetermau ( 2019-03-18 17:54:09 +0200 )edit

@petermau: Sorry. I think you are wrong with respect to the conclusions concerning this question. I recently studied TextField objects for date and/or time in detail. They store the value in a specific structure (not as the numeric value used in Calc cells, but using separate fields for year, month ...), and they also store the .NumberFormat property.
As I see the single date field contained in the Untitled 1 created from the template the OP provided, this .NumberFormat has the key 10084 and the locale associated with it is Language = "en" and Country = "USA" while the code still is "YYYY-MM-DD" and the display is correct on my system. How do you see it?.

Lupp gravatar imageLupp ( 2019-03-18 18:20:11 +0200 )edit