Issue 32479

Summary: Dates in spreadsheet pasted into word processing or presentation document are incorrect.
Product: Calc Reporter: ferd913 <sullivan>
Component: uiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Bugdoc with zero date set to 01/01/1900 none

Description ferd913 2004-08-02 22:53:52 UTC
When I copy cells containing dates from a spreadsheet and paste into either a
word processing document or a presentation document, the resulting dates are off
by approximately 4 years.  The number that's being pasted is correct - or at
least, the same as it appears in the spreadsheet.  But the dates show up as
incorrectly.  It looks like the date formatting functions are using a base year
that is 4 years earlier than what happens in the spreadsheet.

If I paste special, say, RTF, the pasted dates are correct.
Comment 1 michael.ruess 2004-08-03 08:00:07 UTC
Sounds like the spreadsheet's OLE content is corrupted.
Comment 2 frank 2004-08-03 09:39:37 UTC
Hi,

tried it using OOo1.1.2 on Linux and can't reproduce with the given information.

Please give us a step by step description on how to double your problem. A
document with the source data and the target document with pasted values would
also be fine.

Frank
Comment 3 ferd913 2004-08-03 18:50:36 UTC
I also can't reproduce the problem with a new spreadsheet.  But it certainly
occurs with an existing one.  I can't figure out how update with an attachment.
I'll email the spreadsheet and word processor to document to fst@openoffice.org.
Comment 4 frank 2004-08-04 10:32:37 UTC
Hi,

got your files, will attach the calc to this Issue later. There seems to be a
bug in Issuezilla which prevents people who are not owners of an Issue to attach
files on it.

Now let's start with your problem. This is caused by the non default Null date
for the Calc file you've send. Check this under Tools Options Spreadsheet
Calculate Date. This is set to 01/01/1904. AFAIK this is from Excel to
compensate a date bug present since Excel2.0 making 1900 a leapyear but it never
was one. So changing the Zero date may workaround the problem.

Frank
Comment 5 frank 2004-08-04 10:33:53 UTC
Created attachment 16937 [details]
Bugdoc with zero date set to 01/01/1900
Comment 6 frank 2004-08-04 10:35:44 UTC
Hi Niklas,

Eike and I talked about copying the zero date with the Calc OLE.

Therefore I set this one to P4 OOoLater

Frank
Comment 7 ferd913 2004-08-04 15:40:57 UTC
I agree that the problem is the zero date.  However, changing the zero date
isn't really a workaround.  Yes, that makes the dates match between spreadsheet
and other applications.  However, it also makes the dates imported from Excel
wrong in both places.

What I don't understand is that if I create a new Excel document and import it,
I don't have the problem.  Is it possible that this is happening because my
Excel document was created with a really old version of Excel?  It's possible,
but I can't remember how long ago the document originated (but it's at most
about 4 years).
Comment 8 frank 2004-08-04 15:48:43 UTC
Hi,

yeeeppp, this would be the case I think. 

If you change the zero date under tools options spreadsheet if you are in the
writer document, you do not have the shifting problem. But make sure this is set
only for this document or just use formatted text from paste special to insert
the clipboard content. In this case you do not get an Calc OLE but the data is
correct as it is now just text.

Frank
Comment 9 ferd913 2004-08-04 20:49:57 UTC
I don't see a direct way to change the base date just for a document - but
here's what I did that seems to be ok, so I think this is a workaround.

1.  Open spreadsheet with 2004 base date.
2.  Create word processor doc.
3.  Set base date to 2004 (which seems to change it globally).
4.  Paste in the spreadsheet.
5.  Change base date back to default, so that other documents aren't munged.

Now the dates are ok.  I closed the documents and reopened, and the dates are
correct.

Thanks for the help!
Comment 10 Marcus 2017-05-20 11:11:27 UTC
Reset assigne to the default "issues@openoffice.apache.org".