Forum Discussion

rancohen's avatar
rancohen
Occasional Contributor
6 years ago
Solved

compare two variables between values

Hi,   I have textbox that show time with seconds. I need to verify number of seconds pass from last reading, since the test take also time I have mistaken of +/-1 second in the test and that's ...
  • NisHera's avatar
    6 years ago

    depending on your language 

    you can use something like... (this is sudo code)

    first if values are in string format convert to time..

     

    now_time = String_todatetime("String_now_Time");
    old_time = String_toDatetime("String_old_Time")

    if your languge is VBScript may look like this

    then compare .............


    if ((now_time - old_time)=>2) {     Log.Error("got more than 2 secs"); }