Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter - get current date and time

Tags:

jmeter

I want to get the current date and time as example date: 11/10/2014 and time 8:30 am or 6:00 pm and pass it as parameters to my Jmeter test. Can some help me do this.

like image 304
user3920295 Avatar asked Nov 20 '14 15:11

user3920295


People also ask

How does JMeter correlate date and time?

Use __time function: ${__time(dd/MM/yyyy,)}

What is timestamp in JMeter report?

The timestamp format is used for both writing and reading files. If the format is set to "ms", and the column does not parse as a long integer, JMeter (2.9+) will try the following formats: yyyy/MM/dd HH:mm:ss. SSS.


1 Answers

Use __time function:

  • ${__time(dd/MM/yyyy,)}

  • ${__time(hh:mm a,)}

Since JMeter 3.3, there are two new functions that let you compute a time:

__timeShift

  "The timeShift function returns a date in the given format with the specified amount of seconds, minutes, hours, days or months added" and  

__RandomDate

  "The RandomDate function returns a random date that lies between the given start date and end date values."  

Since JMeter 4.0:

dateTimeConvert

Convert a date or time from source to target format 

If you're looking to learn jmeter correctly, this book will help you.

like image 83
UBIK LOAD PACK Avatar answered Sep 19 '22 00:09

UBIK LOAD PACK