如何计算HP LoadRunner中两个日期之间的天数。
我对C语言编码的经验有限。
答案 0 :(得分:0)
如果您有冒险精神,可以这样做:
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);