1

How does one Calculate the number of Days between 2 dates in HP LoadRunner.

I have limited experience with C language coding.

Christoff Erasmus
  • 925
  • 1
  • 10
  • 26

1 Answers1

0

If you are feeling adventurous you can do this:

web_js_run(
    "Code=days_between=function(firstDate,secondDate) {return Math.floor((Date.parse(secondDate)-Date.parse(firstDate))/1000/60/60/24);}",
    LAST);

lr_save_string("11/20/2017 23:41:20","D1");
lr_save_string("12/01/2017 02:56:32","D2");

web_js_run(
    "Code=days_between(LR.getParam('D1'),LR.getParam('D2'));",
    "ResultParam=days_between",
    LAST);      
Buzzy
  • 2,905
  • 3
  • 22
  • 31