COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-16
CURRENT-DATE Function
CURRENT-DATE Function
CURRENT-DATE, an alphanumeric function, returns a 21-character string that
represents the calendar date, time of day, and local time differential factor provided by
the operating environment.
The returned value represents the current date this way (where character position 1 is
the leftmost character position):
The date in Example 14-8 is April 11, 1997 (19970411). The time is 16:52:22.24 or
4:52:22.24 PM (16522224), which is 7 hours behind Greenwich mean time (-0700).
Character
Positions Date Part Represented Represented by
1-4 Year in Gregorian calendar Four digits
5-6 Month of the year Two digits in the range 01 through 12
7-8 Day of the month Two digits in the range 01 through 31
9-10 Hours past midnight Two digits in the range 00 through 23
11-12 Minutes past the hour Two digits in the range 00 through 59
13-14 Seconds past the minute Two digits in the range 00 through 59
15-16 Hundredths of seconds past
the second
Two digits in the range 00 through 99
17 Relationship to Greenwich
mean time
Minus (-) if the reported time is behind
Greenwich mean time, plus (+) if it is the
same as or ahead of Greenwich mean
time
18-19 Hours behind or ahead of
Greenwich mean time
If character position 17 is minus (-), two
digits in the range 00 through 12; if
character position 17 is plus (+), two digits
in the range 00 through 13
20-21 Additional minutes from
Greenwich mean time
Two digits in the range 00 through 59
Example 14-8. CURRENT-DATE Function
Code:
DISPLAY FUNCTION CURRENT-DATE
Output:
1997041116522224-0700
CURRENT-DATEFUNCTION
VST427.vsd