How do I generate a timestamp and put it in a variable in jmeter? So that the variable can be passed in the URL.
Asked
Active
Viewed 3.6k times
1 Answers
28
Add the following function wheerever you want to send the Unix based timestamp:
${__time(,curTime)}
you can refer the value using ${curTime}
in later requests.
Example:
HTTP Sampler
in View Results Tree
You can use Function Helper Dialog (in Options), to generate the code:
Note: you can also save the value using name of the variable
(second row), so later you can refer the same value.
Note: you can also format the time, based on your needs (first row).
Reference:

Naveen Kumar R B
- 6,248
- 5
- 32
- 65
-
2Thanks Naveen - That is exactly what i am looking for. – Nikhil Nov 25 '16 at 11:48