change locale for commandline conversion


I’m having some trouble with the correct date format when converting from xlsx to pdf. The issue is the locale setting in libre office. I convert the documents with the following command, but it fails when I have documents from different locale (in my testscenario en-us and german). I want all documents to be formatted in the german way when converting with the command line, but the only thing that helped so far was changing the locale in the settings. Is there a way to specifcy the locale either through command line or by changing something in a config file? Since I have a conversion running on multiple different servers I would have to change the settings by hand for each one, which I’d like to avoid.

The command I’m current running is the following:

soffice.exe --headless --norestore --nofirststartwizard --convert-to pdf C:\testdate.xlsx

Specifying the language like this --language=de did not help with the dateformat issues.

Thanks in advance.

Just as a comment, since I don’t know how (if at all) this could work on Windows (which according to given test file path and .exe extension seems to be your operating system). On Linux simply changing the language environment of the of the starting process and using a temporary user profile does the trick.

LANG=de_DE.UTF-8 libreoffice6.4 -env:UserInstallation=file:///tmp/LO --headless --norestore --nofirststartwizard --convert-to pdf TestLocaleConversionOnCommandLine.xlsx

(Using this type of special conversion-user-profile just for the conversion and having the correct settings, could also be a path to a solution for you. This way you become independent from your default user profile)