CURRENT-DATE Function

The CURRENT-DATE function returns a 21-character alphanumeric value that represents the calendar date, time of day, and local time differential factor provided by the system on which the function is evaluated. The type of this function is alphanumeric.

Usage

FUNCTION CURRENT-DATE

Returned Values

  1. The character positions returned, numbered from left to right, are described in the table below.
    Character Position Contents
    1-4 Four numeric digits of the year in the 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 of 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-16 Two numeric digits of the hundredths of a second past a second, in the range 00 through 99. The value 00 is returned if the system on which the function is evaluated does not have the facility to provide the fractional part of a second.
    17 The character '0'. This is reserved for future use.
    18-19 The characters '00'. This is reserved for future use.
    20-21 The characters '00'. This is reserved for future use
  2. If the system does not have the facility to provide fractional parts of a second, the value 00 is returned in character positions 15 and 16.
  3. If the system does not have the facility to provide the local time differential factor, the value 00000 is returned in character positions 17 through 21.
  4. Currently, we do not support the information contained in positions 17- through 21. These fields will contain 0.
  5. The returned value can be reference modified. For example:
       MOVE FUNCTION CURRENT-DATE (1:4) TO YEARDATE.