Bug 366604 - date parameters are one hour off from 10/10/11 to 10/16/11
Summary: date parameters are one hour off from 10/10/11 to 10/16/11
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Birt-Data-inbox@eclipse.org CLA
QA Contact: Sissi Zhu CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-13 14:08 EST by A N CLA
Modified: 2012-01-06 13:46 EST (History)
1 user (show)

See Also:


Attachments
Sample report design to test with (20.53 KB, application/octet-stream)
2012-01-06 13:46 EST, A N CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description A N CLA 2011-12-13 14:08:18 EST
Build Identifier: M20090211-1700

The discussion on the forums for this problem can be found here:
http://www.eclipse.org/forums/index.php/t/264421/

The timezone setting on the workstation I am using is BRST (GMT - 2). When I run a report that uses startdate and enddate parameters, if either parameter falls within the 10/10/11 to 10/16/11 range, the absolute time (midnight) on the header of the report design is correct, but the timezone (GMT - 2 or BRST) is incorrect. However, when I output the params individually to a log, the opposite problem occurs. The timezone is now correct, but the absolute time (one hour off, and thus one day earlier) is incorrect.

Suppose I input the startdate parameter as 10/5/11 and the enddate parameter as 10/14/11.

The header of the report will look like this:

Start Date: October 5, 2011 12:00:00 AM GMT-03:00
End Date: October 14, 2011 12:00:00 AM GMT-02:00

Error: The end date timezone should be GMT-3, since BRST (GMT-2) did not start until October 16th.

The output to the log will look like this:

Start Date: Wed Oct 05 00:00:00 BRT 2011
End Date: Thu Oct 13 23:00:00 BRT 2011

Error: The end date day and time is incorrect, it should be October 14th at midnight. However, the timezone is correct (BRT).

In both places, params["startdate"] and params["enddate"] were used to obtain the date and time information, and were not modified. It is necessary for params["startdate"] and params["enddate"] to be exactly as the user input them, since they will be formatted to be used in an SQL query.

Reproducible: Always

Steps to Reproduce:
1. Ensure the timezone setting for the workstation and any other tools are set to Brasilia (UTC-3).
2. Run a report that requires startdate and enddate parameters. Ensure that the dates are displayed on the report (the header).
3. Enable logging and log the values for params["startdate"] and params["enddate"].
4. Set the startdate and enddate parameters somewhere between 10/10/2011 and 10/16/2011 (inclusive). This is the time range that is impacted by the error.
5. Check the values for startdate and enddate, both on the report and in the log. The result should be similar to what was described in the summary.
Comment 1 Xiaoying Gu CLA 2011-12-31 01:29:43 EST
I can't reproduce this issue.
Could you provide a sample report I can test with?

Thanks
Comment 2 A N CLA 2012-01-06 13:46:14 EST
Created attachment 209144 [details]
Sample report design to test with

Xiaoying,

I have created a sample report that exhibits the problem using the data source provided by the BIRT designer (Classic Models). It has startdate and enddate parameters, which you can modify upon previewing the report. If you select a date range within 10/10/2011 to 10/16/2011 (MM/DD/YYYY), then the timezone will show GMT - 2 (BRST) on the report output, which is incorrect (It should be GMT - 3 or BRT). I have run this test on two different machines with the appropriate environment settings (Brazilian locale and Brasilia timezone) and the error occurs on both machines. If you have any questions, let me know.

Thanks