Loading...
Select Version
The CURRENT-DATE function returns a 21-character alphanumeric value that represents the calendar date and time of day.
The type of this function is alphanumeric.
Format
FUNCTION CURRENT-DATE
Returned value
The character positions returned, numbered from left to right, are:
Character position Contents 1-4 Four numeric digits of the year (Gregorian calendar). 5-6 Two numeric digits of the month of the year, in the range 01 through 12. 7-8 Two numeric digits of the day of the month, in the range 01 through 31. 9-10 Two numeric digits of the hours past midnight, in the range 00 through 23. 11-12 Two numeric digits of the minutes past the hour, in the range 00 through 59. 13-14 Two numeric digits of the seconds past the minute, in the range 00 through 59. 15-21 0000000
See also: DATE-OF-INTEGER, DAY-OF-INTEGER, INTEGER-OF-DATE, INTEGER-OF-DAY, WHEN-COMPILED
Example 9-9
... DATA DIVISION. WORKING-STORAGE SECTION. 01 A-DATE PIC XXXX/XX/XXBBXXBXXBXXBXXBBX(5). PROCEDURE DIVISION. P1 SECTION. MAIN. MOVE FUNCTION CURRENT-DATE TO A-DATE. DISPLAY A-DATE UPON T.
Result: 1995/08/10 14 36 19 00 00000