time, ctime, ctime64, ltime, ltime64, gmtime, gmtime64 - return system time
INTEGER*4 FUNCTION time() FORTRAN version in 32-bit environments
INTEGER*8 FUNCTION time() FORTRAN version in 64-bit environments
INTEGER n CHARACTER*24 FUNCTION ctime(n)
INTEGER*8 n8 CHARACTER*24 FUNCTION ctime64(n8)
INTEGER*4 stime, tarray(9) CALL ltime(stime, tarray)
INTEGER*8 stime8 INTEGER*4 tarray(9) CALL ltime64(stime8, tarray)
INTEGER*4 stime, tarray(9) CALL gmtime(stime, tarray)
INTEGER*8 stime8 INTEGER*4 tarray(9) CALL gmtime64(stime8, tarray)
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 operating system clock.
Usage:
integer*4 n, time n = time()
ctime() returns the system time, stime, as a 24-character string. For example, the program:
character*24 ctime integer*4 time print*, ctime(time()) end
prints the following:
Tue Sep 8 17:01:03 1998
ltime() and gmtime() split system time into various time units for the local time zone (ltime) or as GMT (gtmtime). These units are returned in a nine-element INTEGER*4 array as follows:
tarray 1 through 9, index, units, and range:
1 Seconds (0 - 61) 2 Minutes (0 - 59) 3 Hours (0 - 23) 4 Day of month (1 - 31) 5 Months since January (0 - 11) 6 Year - 1900 7 Day of week (Sunday = 0) 8 Day of year (0 - 365) 9 Daylight Standard Time, 1 if DST in effect
64-bit versions of ctime(), ltime(), and gmtime() are provided. These take an INTEGER*8 time value.
After January 19, 2038, at 3:14:07 GMT, the time() value of seconds since January 1, 1970 will exceed the range of INTEGER*4. To calculate such dates with these routines, use the 64-bit versions and an INTEGER*8 argument.
When compiled to run in a 64-bit environment, time() will return an INTEGER*8 value. Compiling for 64-bit environments means compiling the program with the -m64 option and running the program on a 64-bit platform in a 64-bit operating environment.
libfsu.a
itime(3F), idate(3F), fdate(3F), ctime(3C)
For the C version of ctime(), type:
man -s 3C ctime
Fortran Library Reference Manual