When using a full datetime format for a variable (fields>>variables>>user field or set variable) like "1999-01-01 11:22:33" it seems the dialog mishandles the decimal point. I had my test set to Hungarian, which uses comma (,) as a decimal separator, so the input field for "1999-01-01 12:00" generated a string like "43210,12345" which resulted "1899-12-31 12:00" since the dialog seem to expect english decimal point, as "43210.12345". Replacing the decimal manually fixed the datetime.
Thanks Peter! Starting from a default document language of en-AU, I reproduced with the steps: 1. Insert > Field > More Fields... > Variables tab > User Field type > Additional formats... 2. In the Format Number dialog that opened: Category = Time, Language = Hungarian, Format = 1999-12-31 13:37:46,000 3. The format code does use the comma, but the preview shows: 1896-08-12 10:22:14.293 4. Press OK 5. Give Name "test_hun" and Value "1999-01-01 12:00", click green tick then Insert. Result: in-document field displayed as "1899-12-30 00:00:00,000" Note that the date is wrong as well when using the format without decimals. Versions: Version: 7.4.6.2 / LibreOffice Community Build ID: 5b1f5509c2decdade7fda905e3e1429a67acd63d CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded Same in master build from today. Already the case in OOo 3.3, even though the preset doesn't have decimals.
Confirmed the workaround where one replaces the decimal comma by a decimal point in the resulting Value after inserting. e.g. replacing "36161,5" by "36161.5". Also reproduced with another language using decimal commas, like French (France).
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/ba6d84b854e1abd3e913423dbcfaf192f7ade7f2 Resolves: tdf#154218 Tie user field content value string to content locale It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/8c8457526a11fd03ed63a86ecdeeb270d5551049 Related: tdf#154218 Actually use the top format selected It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/82ed010cd39351adcd4015e2bdd1591aa869cf18 Resolves: tdf#154218 Use the proper document's SwCalc locale for formula field It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Pending review https://gerrit.libreoffice.org/c/core/+/149936 for 7-5
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/1093fc294ea5a823da4ebcfdafbef3327f9c82bf Resolves: tdf#154218 Use proper locale for user field and set variable It will be available in 7.5.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/fc6806c4be8585ce0d35a6b581bf8b3dbf858500 Related: tdf#154218 Use proper locale in SwUserFieldType::PutValue() It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Eike Rathke committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/eea22152b7544268c5fa2765030ff75cd74ddb3b Related: tdf#154218 Use proper locale in SwUserFieldType::PutValue() It will be available in 7.5.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks Eike for the fix! Fix verified in: Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: fc6806c4be8585ce0d35a6b581bf8b3dbf858500 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded Peter, please feel free to test the fix in a master build: https://dev-builds.libreoffice.org/daily/master/current.html