Forum Discussion

tbom's avatar
tbom
Contributor
11 years ago

Calculating differences (in days) between two DateTime objects

I'm trying to calulate the difference in days, between two dates in my test script. However, it seems that aqDateTime object, doesn't allow for such calculations? Is there someone out there tha...
  • karkadil's avatar
    11 years ago
    This seems to be the easiest way to achieve what you want:




      var Time1 = aqDateTime.Time();


      var Time2 = aqDateTime.AddTime(Time1,8,5,0,5);


      var Difference = aqDateTime.TimeInterval(Time1, Time2);


      Log.Message("The interval in Days:" + aqConvert.TimeIntervalToStr(Difference).split(":")[0]);