.date <conversion_specifier>
Use the .date command with one or more conversion specifier characters as arguments to generate current date-time information when a project runs.
The .date command and its arguments must be defined as an environment variable in an environment. You can then assign the environment to a project or a step.
For example, in an environment, define an environment variable DayofWeek and assign it a value of .date %A. Assign the environment to a project or step. If the project is run on a Wednesday, the job assigns the text Wednesday to the environment variable DayofWeek.
The .date command is built on the POSIX strftime function and accepts conversion specifiers identified by the ANSI C89 standard. Date-time values for conversion specifiers are provided in the following table.
Date Conversion Specifier |
Description |
---|---|
%a |
The abbreviated weekday name according to the current locale. |
%A |
The full weekday name according to the current locale. |
%b |
The abbreviated month name according to the current locale. |
%B |
The full month name according to the current locale. |
%c |
The preferred date and time representation for the current locale. |
%d |
The day of the month as a decimal number (range 01 to 31). |
%H |
The hour as a decimal number using a 24-hour clock (range 00 to 23). |
%I |
The hour as a decimal number using a 12-hour clock (range 01 to 12). |
%j |
The day of the year as a decimal number (range 001 to 366). |
%m |
The month as a decimal number (range 01 to 12). |
%M |
The minute as a decimal number (range 00 to 59). |
%p |
Either "AM" or "PM" according to the given time value, or the corresponding strings for the current locale. Noon is treated as "pm" and midnight as "am". |
%S |
The second as a decimal number (range 00 to 61). |
%U |
The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. |
%w |
The day of the week as a decimal, range 0 to 6, Sunday being 0. |
%W |
The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01. |
%y |
The year as a decimal number without a century (range 00 to 99). |
%Y |
The year as a decimal number including the century. |
%Z |
The time zone or name or abbreviation. |
%% |
A literal "%" character. |