HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Converting Extracted Tick Time to Normal date Form Messages in this topic - RSS

Unregistered User
Unregistered User
Posts: 509


10/13/2021
Unregistered User
Unregistered User
Posts: 509
We need to fetch Tick time which is coming in previous response. I am using extractor to fetch same.

We need to convert this Tick Time to Normal date Format and use in next request.

Please suggest if we have any option to convert
0 link
George @StresStimulus
George @StresStimulus
Administrator
Posts: 556


10/13/2021
George @StresStimulus
George @StresStimulus
Administrator
Posts: 556
To convert extracted Ticks time to regular time, you will need to use scriptable variables as described https://support.stresstimulus.com/display/doc54/Scriptable+Variables

Below is pseudo code:

/// <summary>
/// Return a value for the given session context.
/// </summary>
/// <param name="session">The session context object of the request consuming the variable.</param>
/// <returns>The source variable value.</returns>
string IExternalVariable.GetValue(SessionContext context)
{
var s_ticks = context.ExtractorRuntime.GetExtractorValue("TickDate"); //TickDate is the extractor that returns ticks
long ticks;
if (long.TryParse(s_ticks, out ticks))
return
new DateTime(ticks).ToString();

return "";
}
0 link






Copyright © 2024 Stimulus Technology