I meant to include this in the original post, but if you look at Test 1, it appears the values are written to the db properly in GMT time, and if I subtract those times (epoch/integers) in the db I get back 3600 (what I expected), but business time 1 gives me a difference of 7200 seconds (2 hours) for the same start/end times.
Axton Grams On 3/6/07, Axton <[EMAIL PROTECTED]> wrote:
I am seeing some strange results in my DST testing in regards to business time. Environment: ARServer 7.0.01 patch 001 SunOS 5.9 Generic_118558-26 Mid-Tier 7.0.01 patch 001 IBM WebSphere Application Server/6.0 IBM Java 1.4.2_11 I took 2 dates, a start and end date, performed a diff, then added the diff to the start and subtracted it from the end; all BT calculations are done in filters on the server side. These are the results of 3 of those tests: Here are the scenarios I ran using the Mid-Tier (just to avoid potential client/MS DST issues): * Test 0 Business Time Type: Business Time 1 TestID: 000000000000109 Start: 3/10/2007 1:00:00 PM End: 3/10/2007 2:00:00 PM Diff Seconds: 3600 Diff Minutes: 60 Diff Hours: 1 Workday: 24 Hr Tag Holiday: 24 Hr Tag Result of Add to Start: 3/10/2007 2:00:00 PM (for all 3 units) Result of Subtract from End: 3/10/2007 1:00:00 PM (for all 3 units) * DB Values: REQUEST_ID: 000000000000109 STARTDATE: 1173549600 ENDDATE: 1173553200 ENDDATE-STARTDATE: 3600 * Test 1 TestID: 000000000000111 Business Time Type: Business Time 1 Start: 3/11/2007 1:00:00 AM End: 3/11/2007 3:00:00 AM Diff Seconds: 7200 Diff Minutes: 120 Diff Hours: 2 Workday: 24 Hr Tag Holiday: 24 Hr Tag Result of Add to Start: 3/11/2007 3:00:00 AM (for all 3 units) Result of Subtract from End: 3/11/2007 1:00:00 AM (for all 3 units) * DB Values: REQUEST_ID: 000000000000111 STARTDATE: 1173592800 ENDDATE: 1173596400 ENDDATE-STARTDATE: 3600 * Test 2 TestID: 000000000000115 Business Time Type: Business Time 1 Start: 3/11/2007 1:00:00 AM End: 3/11/2007 2:00:00 AM Diff Seconds: 3600 Diff Minutes: 60 Diff Hours: 1 Workday: 24 Hr Tag Holiday: 24 Hr Tag Result of Add to Start: 3/11/2007 2:00:00 AM (for all 3 units) Result of Subtract from End: 3/11/2007 1:00:00 AM (for all 3 units) * DB Values: REQUEST_ID: 000000000000115 STARTDATE: 1164780000 ENDDATE: 1164783600 ENDDATE-STARTDATE: 3600 While the add and subtract put the date back at the expected values, the diffs seem to be off for test 1 (which covers the DST switch). For Test 1, I would expect to see 1 hour as the result of the diff (1:00-1:59, then jump to 3:00). This is very odd. Can someone give me a sanity check on what I think I should be seeing? The same workflow was used to generate all the test results (filters on 1 form where I provide the BT version, holiday/workday/segments, start date, and end date). The calculations are done properly when using the time difference provided by the diff, but I am concerned this will cause issues for time calculations where the offset is provided as a constant (e.g. 3/11/2007 1:00:00 AM + 4 hours will result in 4/2/2006 5:00:00 AM, when it should result in 4/2/2006 6:00:00 AM. The 1 hour increments would follow this pattern: 1-3, 3-4, 4-5, 5-6). Thanks, Axton Grams
_______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are"