Forum Discussion

rodrigueA's avatar
rodrigueA
Occasional Contributor
7 years ago
Solved

Keyword test - How set up variable with current hour

Hello,   For 1 of my keyword tests, I must set a variable(integer format)  with current hour (without minutes) in 24H format (ex : If I launch the test at 08H30 PM I want set variable with 20). I ...
  • YuriPeshekhonov's avatar
    7 years ago

    Hi,

     

    You can use the "GetHours" Method for this. Please find the sample script below. You can call it from your KDT or create the same operations in KDT. 

     

    [JScript]

    function DateTest() {
       date = aqDateTime.Now();
       h = aqDateTime.GetHours(date);
       Log.Message(h);
    }