9.3.156 TIME (BUF)

Description:  Returns the current time as set within the system. 
Class:  Subroutine 
Arguments:  BUF is an 8-byte variable, array, array element, or character substring.

The date is returned as an 8-byte ASCII character string taking the form hh:mm:ss, where:
   hh is the 2-digit hour
   mm is the 2-digit minute
   ss is the 2-digit second
If BUF is of numeric type and smaller than 8 bytes, data corruption can occur.

If BUF is of character type, its associated length is passed to the subroutine. If BUF is smaller than 8 bytes, the subroutine truncates the date to fit in the specified length. If a CHARACTER array is passed, the subroutine stores the date in the first array element, using the element length, not the length of the entire array.
 

Examples

An example of a value returned from a call to TIME is 13:45:23 (a 24-hour clock is used).

Consider the following:

CHARACTER*1 HOUR(8)
...
CALL TIME (HOUR)

The length of the first array element in CHARACTER array HOUR is passed to the TIME subroutine. The subroutine then truncates the time to fit into the 1-character element, producing an incorrect result.


Previous Page Next Page Table of Contents