Date and Time (%TIME) Macro
The Date and Time macro is used to insert date and time values into the strings generated by a data source using the Custom String data generator.
The macro is an analog of the Date and Time data generator.
Syntax
The macro has the following syntax:
%TIME(MinDate, MaxDate, Format, GenerationMode, IncrementDay, IncrementHour, IncrementMinute, IncrementSecond)
Parameters
Examples
The following examples demonstrate how to use the Date and Time macro:
%TIME("7/12/2014 00:00:00 AM GMT","10/20/2014 00:00:00 AM GMT","MMM d, yyyy h:mm a", True, 1,1,10,0)
Generates date and time values starting from midnight, July 12, 2014, and increasing each value by one day, one hour and ten minutes. The values have a brief month name and the AM/PM time format:
Jul 13, 2014 5:10 AM Jul 14, 2014 6:20 AM Jul 15, 2014 7:30 AM ...
%TIME("7/12/2014 00:00:00 AM GMT","7/12/2015 00:00:00 AM GMT","dd.MM.YY kk:mm:ss", false, 0, 0, 0, 0)
Generates random date/time values in the range from July 12, 2014, to July 12, 2015. The generated values have the format adopted in Germany and some other European countries:
08.12.14 12:53:51 09.02.15 17:03:00 17.08.14 10:11:17 ...
%TIME("7/12/2014 00:00:00 AM GMT","10/20/2014 00:00:00 AM GMT","dd-MMM-yy", false, 0, 0, 0, 0)
Generates random dates in the range from July 12, 2014, to October 20, 2014. Generated values include only dates (no time):
18-Aug-14 17-Aug-14 17-Sep-14 ...
%TIME("01/10/15 03:05:30 AM GMT","14/10/15 14:05:00 AM GMT","HH:mm:ss", TRUE, 0, 0, 10, 0)
Generates time values starting from 03:05:30 and increasing the value by 10 minutes. The generated values include only time (no date):
03:05:30 03:15:30 03:25:30 ...
Remarks
For more information on adding macros to custom strings, see About Custom String Generator.
For more information on general rules used for specifying macro parameters, see Custom String Generator Rules.