How do I generate a timestamp and put it in a variable in jmeter? So that the variable can be passed in the URL.
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: