Apache OpenOffice (AOO) Bugzilla – Issue 70817
RTF: export mangles foreign Date Field format
Last modified: 2017-05-20 11:15:51 UTC
I create a document in Writer and put a date field in. I change the format to be MMMM DD, YYYY (December 31, 1999). If I save as ODT, no problem. I save as RTF and it sets the format to tt.mm.yy, which even OpenOffice doesn't know what to do with it when you close and then re-open the RTF file. Since Microsoft Word doesn't know what to do with that format either, I am assuming it is an error in the RTF export filter. I will attach a zip file that contains the ODT file with a date field and the resulting RTF file when you do a save as RTF from Writer.
Created attachment 40043 [details] This has the ODT file with a date field and the resulting RTF file from a save as RTF.
What do you mean with "doesn't know what to do with that format"? I have tried your rtf-document in OOom188 on German WinXP and get 10/24/06, which seems correct to me, because the language is English US. I have opened the rtf-document in German Word97 and get 24.10.06, which is my German system date setting, so also correct. In WordPad I get Date: October 24, 2006, which is also correct. Please use a newer version of OOo, at least 2.0.4.
MRU->HBRINKM: this issue is quite similar to issue 29646, but that one is for WW8 filter. When exporting a date field (like in the attached odt) to RTF, MS Word will not be able to display the field correctly. Additionally, the format will be changed to something differently when opening the exported RTF in OO Writer.
The english version of OpenOffice and Microsoft Word do not recognize the tt.mm.yy format and I get the text "tt.mm.yy" in the document instead of the date. The original format was "mmmm dd, yyyy", so at a minimum, it is saving a different format then the one I set to begin with.
Verified, I have the same problem in both Ooo 2.0.2 and 2.0.4 english versions (haven't tried any other versions). The reason that it's working on the German version of WinXP appears to be because OOo is saving the date in the German format ("tt.MM.yyyy"). 'tt' stands for Tag. Also, it's always saving the date in a dotted style, regardless of the separator I choose. When I manually alter the date in the RTF file (with notepad) to "dd.MM.jjjj" (Dutch date code) OpenOffice will open it correctly. I am using the English version of Windows XP set to "Location: Netherlands, The". Wordpad, however, handles the RTF file saved by OpenOffice correctly. Perhaps the problem (in the export/import filter) is the following: - When saving, OOo always saves the date in German localization. - When opening, some windows-native library function is used to convert the datecode into the current date. This seems to only work correctly on the German version of Windows. Example RTF code saved by OOo 2.0.4: {\field{\*\fldinst \\date \\@"tt.MM.yyyy"}{\fldrslt 27-11-2006}} After opening, this results in: "tt.11.yyyy" being displayed. Also, OOo should use the separator from the "fldrslt" field like wordpad does or set the date code correctly.
The Linux version of OOo (2.0.4) is experiencing almost the same problem. Except that the year code is interpreted somewhat correctly, although yyyy which was converted to yy. Datecode DD-MM-YYYY is being displayed as "tt.11.06" under Linux when reloading the document.
This issue still exists in OpenOffice 2.1 (Tested on Linux)
I have found the following: OpenOffice -always- saves the date in the German format, regardless of the language setting. However, when loading the RTF document, the date gets interpreted according to the Language specified in "Options->Language Settings->Languages->Default languages for documents". Therefore, when this setting is set to German, the document will be saved/opened correctly. However, if the setting is set to any other language (Like 'Dutch' or 'English'), the date will end up mangled. So unlike my previous assumption, this issue has nothing to do with the Windows language since the interpretation is based on the OpenOffice language setting. Perhaps an easy/good fix for this issue is to hardcode the German date interpretation in the import filter?
This issue still exists in OpenOffice 2.2.0 (Tested on Windows)
according to release status meeting: target 3.x
.
I just tested this in OpenOffice 2.4.2 and it is saving dates and times correctly in RTF format.
Reset assigne to the default "issues@openoffice.apache.org".