Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
116 views
in Technique[技术] by (71.8m points)

How to increment the time stamp in Jmeter using the random function

I am using the following function to get the time stamp and this is giving me the current time stamp but I want to increment to tomorrow or by n day or r week or l month.

${__time(yyyy-MM-dd'T'hh:mm:ss.SS'Z')}

How to achieve this ?

question from:https://stackoverflow.com/questions/65847150/how-to-increment-the-time-stamp-in-jmeter-using-the-random-function

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is __timeShift() function which allows adding or subtracting arbitrary amount of days, hours, minutes and seconds to/from the current/provided date

Example syntax:

enter image description here

Text version just in case:

- Tomorrow:     `${__timeShift(yyyy-MM-dd'T'hh:mm:ss.SS'Z',,P1D,,)}`
- Week after:   `${__timeShift(yyyy-MM-dd'T'hh:mm:ss.SS'Z',,P7D,,)}`
- etc.

More information:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...