DATE

Read syntax diagramSkip visual syntax diagram
>>-DATE--(--+--------+--)--------------------------------------><
            '-option-'      

returns, by default, the local date in the format: dd mon yyyy (day month year—for example, 13 Mar 1992), with no leading zero or blank on the day. If the active language has an abbreviated form of the month name, then it is used (for example, Jan, Feb, and so on).

You can use the following options to obtain specific formats. (Only the capitalized and highlighted letter is needed; all characters following it are ignored.)
Base
returns the number of complete days (that is, not including the current day) since and including the base date, 1 January 0001, in the format: dddddd (no leading zeros or blanks). The expression DATE('B')//7 returns a number in the range 06 that corresponds to the current day of the week, where 0 is Monday and 6 is Sunday.

Thus, this function can be used to determine the day of the week independent of the national language in which you are working.

Note: The base date of 1 January 0001 is determined by extending the current Gregorian calendar backward (365 days each year, with an extra day every year that is divisible by 4 except century years that are not divisible by 400). It does not take into account any errors in the calendar system that created the Gregorian calendar originally.
Century
returns the number of days, including the current day, since and including January 1 of the last year that is a multiple of 100 in the format: ddddd (no leading zeros). Example: A call to DATE(C) on 13 March 1992 returns 33675, the number of days from 1 January 1900 to 13 March 1992. Similarly, a call to DATE(C) on 2 January 2000 returns 2, the number of days from 1 January 2000 to 2 January 2000.
Days
returns the number of days, including the current day, so far in this year in the format: ddd (no leading zeros or blanks).
European
returns date in the format: dd/mm/yy.
Julian
returns date in the format: yyddd.
Month
returns full English name of the current month, for example, August.
Normal
returns date in the format: dd mon yyyy. This is the default.
Ordered
returns date in the format: yy/mm/dd (suitable for sorting, and so forth).
Standard
returns date in the format: yyyymmdd (suitable for sorting, and so forth).
Usa
returns date in the format: mm/dd/yy.
Weekday
returns the English name for the day of the week, in mixed case, for example, Tuesday.
Here are some examples, assuming today is 13 March 1992:
DATE()         ->    '13 Mar 1992'
DATE('B')      ->    727269
DATE('C')      ->    33675
DATE('D')      ->    73
DATE('E')      ->    '13/03/92'
DATE('J')      ->    92073
DATE('M')      ->    'March'
DATE('N')      ->    '13 Mar 1992'
DATE('O')      ->    '92/03/13'
DATE('S')      ->    '19920313'
DATE('U')      ->    '03/13/92'
DATE('W')      ->    'Friday'
Note: The first call to DATE or TIME in one clause causes a time stamp to be made that is then used for all calls to these functions in that clause. Therefore, multiple calls to any of the DATE or TIME functions or both in a single expression or clause are guaranteed to be consistent with each other.

Reference Reference

Feedback


Timestamp icon Last updated: Tuesday, 7 January 2014


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic/com.ibm.cics.rexx.doc//dfhrx/date.html