Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345310

Summary: Inconsistent output for BirtDateTime.diffSecond
Product: z_Archived Reporter: Missing name <agl.vijay>
Component: BIRTAssignee: Birt-Data-inbox <Birt-Data-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: bluesoldier
Version: 2.5.2   
Target Milestone: 2.6.2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Need-Auto
Attachments:
Description Flags
test report none

Description Missing name CLA 2011-05-10 14:27:32 EDT
Sometime following gives -60 when "from date" is greater than "to date" and some time it gives 43190. (when there is a minut diffrence)

dateFrom = params["Date From"].value;
dateTo = params["Date To"].value;
BirtDateTime.diffSecond(dateFrom,dateTo)
Comment 1 Xiaoying Gu CLA 2011-05-13 01:40:12 EDT
Could you please give me the detail value of your parameter which can reproduce this issue?

I tried with 2.5.2 release with below parameter value and did not reproduce the issue:
dateFrom:2012-5-13 13:31:00
dateTo:2011-5-13 13:30:00
Comment 2 Missing name CLA 2011-05-13 02:05:36 EDT
1) From Date and To Date of Type Date Time
2) Format for these are custom (MM/dd/yyyy hh:mm)

Thanks,
Vj~
Comment 3 Xiaoying Gu CLA 2011-05-13 02:22:21 EDT
(In reply to comment #2)
> 1) From Date and To Date of Type Date Time
> 2) Format for these are custom (MM/dd/yyyy hh:mm)
> 
> Thanks,
> Vj~

I was using the datetime type and custom format(MM/dd/yyyy hh:mm). 
Please see my attached report design.
Comment 4 Xiaoying Gu CLA 2011-05-13 02:23:06 EDT
Created attachment 195558 [details]
test report
Comment 5 Missing name CLA 2011-05-13 09:59:49 EDT
Thanks You Sir,

That helps a lot , now only quetion i have is why does it  [ BirtDateTime.diffSecond(dateFrom2,dateTo2)]  shows -31622400
even though value of to and from date is same.
Comment 6 Xiaoying Gu CLA 2011-05-15 21:53:15 EDT
(In reply to comment #5)
> Thanks You Sir,
> 
> That helps a lot , now only quetion i have is why does it  [
> BirtDateTime.diffSecond(dateFrom2,dateTo2)]  shows -31622400
> even though value of to and from date is same.

It seems that this is a bug in the 2.5.2 release.
But I can not reproduce this issue in the latest 2.6.2 release build.
Please have a try with the latest 2.6.2 build.
Comment 7 Xiaoying Gu CLA 2011-05-17 02:23:12 EDT
Set as fixed based on comment #6.