Apache OpenOffice (AOO) Bugzilla – Issue 22688
Dates are shifted of -2 days: Insert Database Columns as Text
Last modified: 2006-05-31 14:29:06 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
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
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
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.
. *** This issue has been marked as a duplicate of 23878 ***
submitted issue 24313, to also care for this problem on the 1.1.x branch
closing duplicate
change subcomponent to 'none'