Quantcast
Channel: All LoadRunner Practitioners Forum posts
Viewing all articles
Browse latest Browse all 12134

Re: datetimestamp have an issue

$
0
0

Hi,

For first question, you could use:

   lr_save_datetime("%a %B %d %H:%M:%S %Y", DATE_NOW, "next");

The output is:

   Action.c(6): Notify: Saving Parameter "next = Fri May 02 16:33:24 2014"

 

For second question, the example is to show the next day, the option + ONE_DAY sum one to the current day. The function information for lr_save_datetime shows that this is the correct format for day using %d, this option display day of month (01-31).

To resolve this you need to format the output like:

    lr_save_datetime("%a %B ", DATE_NOW, "val1");
    lr_save_datetime("%d", DATE_NOW, "val2");
    lr_save_datetime(" %H:%M:%S %Y", DATE_NOW, "val3");
    
    lr_param_sprintf ("next", "%s%d%s",  lr_eval_string("{val1}"),  atoi(lr_eval_string("{val2}")),lr_eval_string("{val3}"));

 

The output is:

   Action.c(6): Notify: Saving Parameter "val1 = Fri May ".

   Action.c(7): Notify: Saving Parameter "val2 = 02".

   Action.c(8): Notify: Saving Parameter "val3 =  16:57:01 2014".

   Action.c(10): Notify: Parameter Substitution: parameter "val1" =  "Fri May "

   Action.c(10): Notify: Parameter Substitution: parameter "val2" =  "02"

   Action.c(10): Notify: Parameter Substitution: parameter "val3" =  " 16:57:01 2014"

   Action.c(10): Notify: Saving Parameter "next = Fri May 2 16:57:01 2014".

 

Rodolfo Leitón

HP LR/PC Support

If you are customer you can try posting on our internal forums for more personalized support.

For LoadRunner here.
For Performance Center here.

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.

If you found this information useful please leave a kudo.


Viewing all articles
Browse latest Browse all 12134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>