Issue 22688 - Dates are shifted of -2 days: Insert Database Columns as Text
Summary: Dates are shifted of -2 days: Insert Database Columns as Text
Status: CLOSED DUPLICATE of issue 23878
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC4
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: Oliver Specht
QA Contact: issues@dba
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-20 20:39 UTC by Unknown
Modified: 2006-05-31 14:29 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2003-11-20 20:39:04 UTC
In a "Datasource" dbf table with 1000 records
with this structure:

DATAESAME,D	(date)
COGNOME,C,30	(char)
NOME,C,30	
DATANASCIT,D	
INDIRIZZO,C,50	
CITTA,C,30	
TELEFONO,C,30	
PRESTAZION,C,50	
PROVENIENZ,C,30	
MEDICO,C,50	
REFERTO,M	(memo)

If you click the Data to text.. icon --> Insert Database Columns
as Text (*): if you insert text and dates this way,as an example
    <cognome>  <nome>  <datanascit>  <dataesame>
    
in english
    <surname>  <firstname> <birthdate>  <examdate>
    
dates (in Italy format is DD/MM/YYYY or DD-MM-YYYY) are transfered
in the text with a minus two days error for example this patient 
data: 

	ROMANO Rosalba 15-08-1957 02-10-2003

are transfered in the text as:

	ROMANO  Rosalba  13/08/57  30/09/03

(note that the date format is not maintained, although I used the
option 
	Format(DATAESAME) --> (*) From Database
is it another bug?)
This error was produced on the same data both with a .dbf file and
an MySQL/odbc table. The bug is present both in the Windows (I use
WinXP pro) and in RedHat 9.0 Linux.

Best regards
Daniel Liscia
Comment 1 marc.neumann 2003-11-24 07:44:47 UTC
Hi,

I can reproduce this.

- Create a new dbf table with a date field,
- insert any date in the table
- insert the row as text into textdocument
==>> the date is shifted.

Bye Marc
Comment 2 alex.thurgood 2003-12-21 13:50:17 UTC
Couldn't this be fixed for 1.1.1 ?
I've started to build a complete IP management system for my firm that will
integrate OOo with MySQL. We are very dependent on accurate date calculation for
this, and I'd rather not have to go with PHP. 

Alex
Comment 3 Frank Schönheit 2004-01-05 09:02:51 UTC
Depending on what's the reason for the problem, it may be possible. However,
dates in dbf, and a wrong shifting when inserted in the applications, have
always been somewhat fragile, and we should not touch this for a product update
without explicitly knowing that we don't break anything there.

fs->os: What null date do you use for the date calculation? I strongly assume
that you're using the usual null date of the writer - which unfortunately isn't
the null date which is used in the database world, but differs by two days.
You may consider using DBTypeConversion::toStandardDbDate resp.
DBTypeConversion::toNullDate resp. DBTypeConversion::getStandardDate when
manipulating date values which originate from a database.
Comment 4 Oliver Specht 2004-01-07 15:02:51 UTC
.

*** This issue has been marked as a duplicate of 23878 ***
Comment 5 Frank Schönheit 2004-01-12 14:01:20 UTC
submitted issue 24313, to also care for this problem on the 1.1.x branch
Comment 6 Frank Schönheit 2004-01-12 14:01:43 UTC
closing duplicate
Comment 7 hans_werner67 2004-02-02 12:28:51 UTC
change subcomponent to 'none'