Apologies if this is in the wrong place (my first bug report) The dates in Report Builder are incorrect by 2 days (behind). (I'm running on Ubuntu 14.04 (Using PPA http://ppa.launchpad.net/libreoffice/libreoffice-4-4/ubuntu), however, same issue occurs on Windows version. This may be a recurring bug (i.e it was first detected Bug 67186 - though this appears to have been resolved and fixed)
Could you attach an example by using this link: https://bugs.documentfoundation.org/attachment.cgi?bugid=91022&action=enter ?
Created attachment 115273 [details] Example LO Database File showing incorrect Dates in Report The TimeStamps in the Database table are 1/5/2015 14:00 (1 May 2015) but in the Reports they are displayed as 29/4/2015.
I could reproduce the bug for all LO-versions since LO 4.4.0.0 beta1. All versions before (except all 4.0-versions) give the correct date in the report, created by the legacy report-wizard. Remember: Standard of LO is the Report-Builder, not the old legacy wizard. My system: OpenSUSE 13.2 64bit rpm Linux.
Could reproduce this in latest version 4.4.4.3, Windows 64 bit.
This seems to have begun at the below commit. (Can't immediately see a BZ account for the author to Cc:) commit 5d8ecad569fd7a254902da154ed8057ec61f3a83 Author: Robert Antoni Buj i Gelonch <robert.buj@gmail.com> Date: Wed Oct 29 17:34:18 2014 +0100 java: Method uses the same code for two switch clauses Change-Id: Ied82b0a39ff9dc9c7cc9539dec2b963059f3d4a5 Reviewed-on: https://gerrit.libreoffice.org/12139 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com> Specifically this hunk looks pretty suspicious to me case DataType.TIME: // == 92; + case DataType.TIMESTAMP: // == 93; oAny = getColumnDoubleValue(ColIndex, false); break; - case DataType.TIMESTAMP: // == 93; - oAny = getColumnDoubleValue(ColIndex, true);
Adding committer Robert to CC @Robert : any idea here why this might have happened ?
On pc Debian x86-64 with master sources updated today, I could reproduce this. Matthew: you were right! I tried this: diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index b71ae99..21be84a 100644 --- a/wizards/com/sun/star/wizards/db/RecordParser.java +++ b/wizards/com/sun/star/wizards/db/RecordParser.java @@ -131,12 +131,14 @@ public class RecordParser extends QueryMetaData case DataType.FLOAT: // == 6; case DataType.REAL: // == 7; case DataType.DOUBLE: // == 8; - case DataType.DATE: // == 91; case DataType.TIME: // == 92; - case DataType.TIMESTAMP: // == 93; oAny = getColumnDoubleValue(ColIndex, false); break; + case DataType.DATE: // == 91; + case DataType.TIMESTAMP: // == 93; + oAny = getColumnDoubleValue(ColIndex, true); + break; case DataType.CHAR: // == 1; case DataType.VARCHAR: // == 12; case DataType.LONGVARCHAR: // == -1; and this worked! Would you mind preparing a patch for gerrit or would you prefer I do it? (it's equal for me since the patch is already there on my laptop! :))
(In reply to Julien Nabet from comment #7) > Would you mind preparing a patch for gerrit or would you prefer I do it? > (it's equal for me since the patch is already there on my laptop! :)) Please feel free, I have lots of other things going on right now :) Thanks
(In reply to Matthew Francis from comment #8) > Please feel free, I have lots of other things going on right now :) Thanks Done! https://gerrit.libreoffice.org/#/c/18210/
Julien Nabet committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ed33646cdecac866ab480bf5770726b4a5bfa6c9 tdf#91022: Incorrect Dates in Report created with legacy report wizard It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I believe this may need another look. Although I came across this bug in LO Base Report Builder, just yesterday I found a similar bug in LO Calc (5.0.0.5) too. The date gets advanced by 2 days when it is imported as part of unformatted text with delimiters into Calc. The given patch seems to address report builder. Would it work for Calc text import too? If not, the actual root bug may possibly be elsewhere and causing the issue common to both Base and Calc.
Julien Nabet committed a patch related to this issue. It has been pushed to "libreoffice-5-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f46d8fd4862bd1a2872f02f132c2267d08a1526c&h=libreoffice-5-0 tdf#91022: Incorrect Dates in Report created with legacy report wizard It will be available in 5.0.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Ravi from comment #11) > I believe this may need another look. Although I came across this bug in LO > Base Report Builder, just yesterday I found a similar bug in LO Calc > (5.0.0.5) too. The date gets advanced by 2 days when it is imported as part > of unformatted text with delimiters into Calc. The given patch seems to > address report builder. Would it work for Calc text import too? If not, the > actual root bug may possibly be elsewhere and causing the issue common to > both Base and Calc. There was indeed a regression here. Indeed, the given patch addresses only legacy report builder so it won't work for Calc. Could you please open a new bugtracker?
Migrating Whiteboard tags to Keywords: (bibisected) [NinjaEdit]