Forum Discussion

NickM's avatar
NickM
Occasional Contributor
6 years ago
Solved

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:Minutes:Seconds format: 0:14:42:02

 

But actual elapsed time more like 10 hours.

 

  • NickM's avatar
    NickM
    6 years ago

    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:Minutes:Seconds format: 0:11:57:07

5 Replies

  • NickM's avatar
    NickM
    Occasional Contributor

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

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      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.

      • NickM's avatar
        NickM
        Occasional Contributor

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

        Will ask you first next time.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      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.

      • NickM's avatar
        NickM
        Occasional Contributor

        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:Minutes:Seconds format: 0:11:57:07