Issue 70817 - RTF: export mangles foreign Date Field format
Summary: RTF: export mangles foreign Date Field format
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: save-export (show other issues)
Version: OOo 2.0.2
Hardware: All Windows XP
: P3 Trivial with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-24 17:50 UTC by sherter
Modified: 2017-05-20 11:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
This has the ODT file with a date field and the resulting RTF file from a save as RTF. (6.31 KB, application/x-compressed)
2006-10-24 17:51 UTC, sherter
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description sherter 2006-10-24 17:50:55 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.
Comment 1 sherter 2006-10-24 17:51:35 UTC
Created attachment 40043 [details]
This has the ODT file with a date field and the resulting RTF file from a save as RTF.
Comment 2 Regina Henschel 2006-10-24 23:03:11 UTC
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.
Comment 3 michael.ruess 2006-10-25 16:10:30 UTC
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.
Comment 4 sherter 2006-11-22 15:01:58 UTC
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.
Comment 5 donvdh 2006-11-27 12:08:10 UTC
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.
Comment 6 donvdh 2006-11-27 21:03:20 UTC
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.
Comment 7 donvdh 2006-12-18 23:14:41 UTC
This issue still exists in OpenOffice 2.1 (Tested on Linux)
Comment 8 donvdh 2007-01-08 16:00:25 UTC
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?
Comment 9 donvdh 2007-04-03 14:00:44 UTC
This issue still exists in OpenOffice 2.2.0 (Tested on Windows)
Comment 10 Mathias_Bauer 2007-12-03 17:05:04 UTC
according to release status meeting: target 3.x
Comment 11 Mathias_Bauer 2007-12-03 17:09:37 UTC
.
Comment 12 sherter 2009-09-28 19:05:59 UTC
I just tested this in OpenOffice 2.4.2 and it is saving dates and times 
correctly in RTF format.
Comment 13 Marcus 2017-05-20 11:15:51 UTC
Reset assigne to the default "issues@openoffice.apache.org".