The Date and Time macro is used to insert data and time values into strings generated with the Custom String generator.
The macro is an analog of the Date and Time data generator.
The macro has the following syntax:
%TIME(MinDate, MaxDate, Format, Step, *SEQ | *RND, *xN)
MinDate and MaxDate
Strings that specify the earliest and latest possible generated dates. The way the macro generates dates within this range depends on the *SEQ or *RND parameter. See below.
MinDate must be an earlier date/time value than MaxDate.
MinDate and MaxDate must have the English (US) date format and the 24-hour time format, for instance,
A string that specifies the format of the generated date/time value. To define the format, use the following symbols:
|d or dd||Day as a number. If you use
|ddd||Brief day name (Mon, Tue, Wed, and so on).|
|dddd||Full day name (Monday, Tuesday, Wednesday, and so on).|
|M or MM||Month as a number. If you use
|MMM||Brief month name (Jan, Feb, Mar, and so on).|
|MMMM||Full month name (January, February, March, and so on).|
|y or yy||Two last digits of the year, for instance, 13 for 2013 and 95 for 1995.|
|yyy or yyyy||Full year (2013, 1995 and others).|
|H or HH||Hours in the 24-hour time format. If you use
|h or hh||Hours in the 12-hour time format. Use these symbols with the
|m or mm||Minutes. If you use
|s or ss||Seconds. If you use
All other symbols in the parameter are treated literally.
When specifying this parameter, remember the format that is accepted by the web application or server under test. The date/time values should be in the format that the application (server) expects, not in the format that is used on your computer.
The default value of the parameter is
This parameter is used only if the *SEQ mode is selected (see below). It specifies the number of days, hours, minutes and seconds to be added to the previously generated value to get a new value. If the *RND mode is selected, the parameter is ignored and can be skipped.
The parameter value should have the format
d:H:m:s (see above).
The default parameter value is
1:12:24:48 (1 day, 12 hours, 24 minutes and 48 seconds).
*SEQ or *RND
Specifies the functioning mode for the generator:
*SEQ- If this value is specified, the macro will use MinDate as the first generated value and increase it on Step to get the next generated values.
*RND- If this value is specified, then for each generated custom string the macro produces an arbitrary date/time value within the MinDate...MaxDate range.
Optional parameter. Specifies the number of possible repetitions of each value in series of generated strings. N is a positive number that specifies the number of repetitions: 1, 2, 3, and so on. The default parameter value is
*x1 (no repetitions).
The following examples demonstrate how to use the Date and Time macro:
%TIME("7/12/2013 04:05:00","10/20/2013 04:05:00","MMM d, yyyy h:mm tt", 1:1:10:0)
Generates date/time values starting from July 12, 2013 and increasing each value by one day, one hour and one minute. The values have a brief month name and the 12-hour time format (AM/PM):
Jul 12, 2013 4:05 AM
Jul 13, 2013 5:15 AM
Jul 14, 2013 6:25 AM
%TIME("7/12/2013 01:00:00","7/12/2014 23:00:00","dd.MM.yy HH:mm:ss", *RND)
Generates random date/time values in the range July 12, 2013 … July 12, 2014. Generated values have the format adopted in Germany and some other European countries:
Generates random dates in the range July 12, 2013 … October 20, 2013. Generated values include only dates (no time):
%TIME("03:05:30","14:05:00","HH:mm:ss", 00:10:0, *SEQ, *x2)
Generates time values starting from 03:05:30 and increasing the value by 10 minutes. Generated values include only time (no date). Each value is repeated twice in the sequence of generated custom strings: