───DATE(──┬─────────┬─)────── └─option──┘
DATE returns, by default, the local date in the format: dd mon yyyy (for example, 27 Aug 1988), with no leading zero or blank on the day. For mon, the first three characters of the English name of the month will be used.
The following options (of which only the capitalized letter is needed, all others are ignored) can be used to obtain alternative formats:
Basedate
┴╓: The origin of January 1, 0001 is based on the Gregorian calendar. Though this calendar did not exist prior to 1582, Basedate is calculated as if it did: 365 days per year, an extra day every four years except century years, and leap centuries if the century is divisible by 400. It does not take into account any errors in the calendar system that created the Gregorian calendar originally.
┴╓: This format is intended to be used as a whole; REXX programs should not make any assumptions about the form or content of the returned string.
Here are some examples:
DATE( ) -> '27 Aug 1988' /* perhaps */DATE('B') -> 725975 DATE('D') -> 240 DATE('E') -> '27/08/88' DATE('L') -> '27 August 1988' DATE('M') -> 'August' DATE('N') -> '27 Aug 1988' DATE('O') -> '88/08/27' DATE('S') -> '19880827' DATE('U') -> '08/27/88' DATE('W') -> 'Saturday'
┴╓: The first call to DATE or TIME in one expression causes a time stamp to be made which is then used for all calls to these functions in that expression. Therefore, if multiple calls to any of the DATE and/or TIME functions are made in a single expression, they are guaranteed to be consistent with each other.