TIME(3F) — FORTRAN LIBRARY ROUTINES
NAME
time, ctime, ltime, gmtime − return system time
SYNOPSIS
character∗24 function ctime (stime)
integer∗4 stime subroutine ltime (stime, tarray)
integer∗4 stime, tarray(9) subroutine gmtime (stime, tarray)
integer∗4 stime, tarray(9)
DESCRIPTION
The function ctime( stime ) converts a system time, stime , and returns it as a 24-character ASCII string. The format is described under ctime(3). No ’newline’ or NULL will be included.
The subroutines ltime and gmtime dissect a SunOS time into month, day, etc., either for the local time zone or as GMT. The order and meaning of the 9 elements returned in tarray is described under ctime(3).
NOTES
For time there are two versions, a SunOS standard version and a VMS version. If you do use -lv77 you get the VMS version, otherwise you get the SunOS version. Standard Version
The function time() returns an integer that contains the time since 00:00:00 GMT, Jan. 1, 1970, measured in seconds. This is the value of the SunOS system clock. Usage:
integer n, time
...
n = time()
VMS Version
The function time gets the current system time as a character string. Usage:
CALL TIME( t ) where t is a variable, array, array element, or character substring, and is of type
CHARACTER∗8 . The string returned is of the form hh:mm:ss , where each of hh , mm , and ss are 2-digits, and where: hh is the hour, mm is the minute, and ss is the second. Example:
demo% cat tim1.f
CHARACTER t∗8
CALL TIME( t )
WRITE ( ∗, "(’ The time is: ’, A8 )" ) t
END
demo% f77 tim1.f -lV77
tim1.f:
MAIN:
demo% a.out
The time is: 08:14:13
demo%
FILES
/usr/lang/SC0.0/libF77.a
/usr/lang/SC0.0/libv77.a
SEE ALSO
ctime(3), idate(3F), fdate(3F)
and the Sun FORTRAN Reference Manual .
Sun Release 4.1 — Last change: 24 January 1990