This procedure returns a 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 functionality is identical to the COBOL85 function CURRENT-DATE.
Explanation
The CURRENT_DATE procedure accepts an EBCDIC ARRAY parameter that must be at least 21 characters long. The character positions returned, numbered from left to right, are as follows:
Table 17. CURRENT_DATE Function, Characters 1–21
|
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 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 the second, in the range 00 through 99. |
|
17 |
One of the following characters: Minus sign (-), which means the local time indicated in the previous character positions is behind Greenwich Mean Time. Plus sign (+), which means the local time indicated is the same as or ahead of the Greenwich Mean Time. Zero (0), which means the system on which this function is evaluated does not provide the differential factor. |
|
18-19 |
The returned value in character positions 18 and 19 depends upon the character in position 17 as shown in Table Section 10-4. |
|
20-21 |
The returned value in character positions 20 and 21 depends upon the character in position 17 as shown in Table Section 10-5. |
Table 18. CURRENT_DATE Function, Characters 18–19
|
If the 17th character is a . . . |
Then the returned value is . . . |
|---|---|
|
Minus sign (-) |
Two numeric digits in the range 00 through 12 indicating the number of hours that the reported time is behind Greenwich Mean Time. |
|
Plus sign (+) |
Two numeric digits in the range 00 through 13 indicating the number of hours that the reported time is ahead of Greenwich Mean Time. |
|
Zero (0) |
00 |
Table 19. CURRENT_DATE Function, Characters 20–21
|
If the 17th character is a . . . |
Then the returned value is . . . |
|---|---|
|
Minus sign (-) |
Two numeric digits (the minute value past the hour value) in the range 00 through 59 indicating the number of minutes that the reported time is behind Greenwich Mean Time. |
|
Plus sign (+) |
Two numeric digits (the minute value past the hour value) in the range 00 through 59 indicating the number of minutes that the reported time is ahead of Greenwich Mean Time. |
|
Zero (0) |
00 |
Example
BEGIN $ INCLUDE INTL = "*SYMBOL/INTL/ALGOL/PROPERTIES." 10000000 - 89999999 EBCDIC ARRAY OUT[0:100]; EBCDIC ARRAY A[0:20]; POINTER P; P := OUT[0]; CURRENT_DATE(A); REPLACE P BY "CURRENT_DATE=", A[0] FOR 21; DISPLAY(P); END.
If run on July 16, 2012 at 11:14 AM Pacific Daylight Time (PDT) the program would display:
2012071611145257-0700

