cancel
Showing results for 
Search instead for 
Did you mean: 

Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.TimeIn

SOLVED
Occasional Contributor

Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.TimeIn

Using Delphi Script:

 

gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd);

 

aqConvert.TimeIntervalToStr(gDifference)

 

When the start and end time runs past midnight the result appears to be the 24 hours minus the difference e.g.

 

Starting at - 180413_155526 - approx 15:55 previous day

Ending at - 180414_011324 - approx 01:11 next day
Elapsed duration for script in Days:Hours:MinutesSmiley Frustratedeconds format: 0:14:42:02

 

But actual elapsed time more like 10 hours.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti

Excellent using the NOW parameter fixed the issue - please see example as below:

 

Starting at - 180424_170500
Ending at - 180425_050207
Elapsed duration for script in Days:Hours:MinutesSmiley Frustratedeconds format: 0:11:57:07

View solution in original post

5 REPLIES 5
Occasional Contributor

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti

Note - I have also logged this on the main Smart Bear site - ref 00291235

Community Hero

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti

You need to make sure that gTimeStart and gTimeEnd include a date value along with the time value.  That's the only way to account for greater than a full day.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Hero

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti


@NickM wrote:

Note - I have also logged this on the main Smart Bear site - ref 00291235


FYI -

 

What that did was connect you with TestComplete Support.  You're perfectly welcome to ask the question both places, but if you get the answer from Support, please post it here to share with others.  People answering questions here are knowledgeable users, but Support still knows a few things that we don't!

 

Also, that reference number is only useful for you and Support.  It doesn't link from anything here.

Occasional Contributor

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti

Excellent using the NOW parameter fixed the issue - please see example as below:

 

Starting at - 180424_170500
Ending at - 180425_050207
Elapsed duration for script in Days:Hours:MinutesSmiley Frustratedeconds format: 0:11:57:07

View solution in original post

Occasional Contributor

Re: Using Delphi Script - gDifference := aqDateTime.TimeInterval(gTimeStart, gTimeEnd); aqConvert.Ti

Sorry to duplicate - relatively new user - your guys came up with answer and very quickly many thanks.

Will ask you first next time.

New Here?
Join us and watch the welcome video:
Watch the new Interview