Timestamp Selector Task
The timestamp selector task displays an Options tab containing a combo box. The choices in the combobox are:
- Specify timestamp - an input field prompting for a timestamp appears
- Current date and time
- Current date and time previous year
- Current date and time next year
- Current hour
- Next hour
- Previous hour
- Current minute
- Next minute
- Previous minute
- N minutes ago - an input field prompts for an integer
- N minutes from now - an input field prompts for an integer
- N hours ago - an input field prompts for an integer
- N hours from now - an input field prompts for an integer
When a selection made and values are specified in any dependent controls the following macro variables are created and set as follows:
- timestamp - the timestamp specified or a function that calculates the value of the selection, formatted as DDMMMYYYY HH:MM:SS
- timestamp_rel - a code that represents the selection made
- timestamp_label - the common name of the selection
An example of the code generated by this task when "Current date and time" is selected:
%global timestamp;
%global timestamp_rel;
%global timestamp_label;
%let timestamp = %sysfunc(datetime(), DATETIME20.);
%let timestamp = %sysfunc(catx(%str( ), %substr(×tamp, 1, 9),
%substr(×tamp, 11, 8)));
%let timestamp_label = Current date and time;
%let timestamp_rel = T0m;
%put _GLOBAL_;
The macro variable values set by this example code are as follows if it is March 22, 2017 at 11:27:27 AM.
GLOBAL TIMESTAMP 22MAR2017 11:33:03
GLOBAL TIMESTAMP_LABEL Current date and time
GLOBAL TIMESTAMP_REL T0m