Skip to content

__RandomDate

JMeter __RandomDate function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Also documented in context in the full Functions and Variables reference.

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

NameRequiredDescription
Time formatNoFormat string for DateTimeFormatter (default yyyy-MM-dd)
Start dateNoThe start date, the default is now
End dateYesThe end date
Locale to use for formatNoThe string format of a locale. The language code must be lowercase. The country code must be uppercase. The separator must be an underscore, e.g. en_EN. See http://www.oracle.com/technetwork/java/javase/javase7locales-334809.html. If omitted, by default the function uses the Apache JMeter locale one.
Name of variableNoThe name of the variable to set.

Examples:

Terminal window
\${__RandomDate(,,2050-07-08,,)}

will return a random date between now and 2050-07-08. For example 2039-06-21

Terminal window
\${__RandomDate(dd MM yyyy,,08 07 2050,,)}

will return a random date with a custom format like 04 03 2034

On this page