Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

CURRENT-DATE - Current date

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

  1. The character positions returned, numbered from left to right, are:

    Character positionContents
    1-4Four numeric digits of the year (Gregorian calendar).
    5-6Two numeric digits of the month of the year, in the range 01 through 12.
    7-8Two numeric digits of the day of the month, in the range 01 through 31.
    9-10Two numeric digits of the hours past midnight, in the range 00 through 23.
    11-12Two numeric digits of the minutes past the hour, in the range 00 through 59.
    13-14Two numeric digits of the seconds past the minute, in the range 00 through 59.
    15-210000000


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